What are the potential security risks associated with incorrect file permissions in PHP scripts?

Incorrect file permissions in PHP scripts can lead to security risks such as unauthorized access to sensitive files, data leakage, and potential exploitation by malicious users. To mitigate these risks, it is important to set appropriate file permissions to restrict access to only authorized users and ensure that sensitive files are not accessible to the public.

// Set appropriate file permissions to restrict access
chmod("/path/to/file.php", 0600);