What are the potential security risks of using CHMOD 775 instead of 750 in PHP scripts?

Using CHMOD 775 instead of 750 in PHP scripts can pose a security risk by allowing group members and others to potentially modify the script, which could lead to unauthorized access or malicious code execution. To mitigate this risk, it is recommended to set more restrictive permissions, such as 750, to limit access to only the script owner.

// Set file permissions to 750 to restrict access to only the script owner
chmod("your_script.php", 0750);