My PHP scripts produce Internal Server Errors (500 error) Print

  • 13

Some of our servers run PHP scripts as your own user instead of the global web server user. PHP scripts should always be set to the permissions of 644 (user = read and write, group = read only, and world/other = read only).

Directories should be set at 711 or 755 (user = read, write and execute, group = execute or read and execute, world/other = execute or read and execute, respectively).

Also, be sure that you don't have any directives for PHP settings in your .htaccess file that might be causing errors, and that the scripts themselves don't suffer from any syntax errors.

Servers running PHP as your own user allow you to upload or create your own php.ini file, which you can store in your account's public_html web root directory itself, rather than using directives in the .htaccess file.

For servers running PHP as module to run the script as the global web server user, you can get away with more open settings (and use .htaccess settings for PHP variables, if needed), though you should not set a file or directory to world write permission unless you absolutely need to.


Was this answer helpful?

« Back

["\r\n