IT Knowledge Base

Technical Repository

HowTo: Update Nginx Configuration to support PHP files

These are the default settings for Nginx. OpenĀ /usr/local/nginx/conf/nginx.conf to edit. nano /usr/local/nginx/conf/nginx.conf location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } Update the nginx.conf file to these settings location ~ \.php$ { root /var/www; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } In order to use […]

Read More


HowTo: Fix “unix:/var/run/php5-fpm.sock failed (13: Permission denied)”

If you look at the /usr/local/nginx/logs/error.log and see the following error, you can use the next steps to resolve the problem. connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx Change the owner of php5-fpm.sock and set permission to 660. chown nginx:nginx /var/run/php5-fpm.sock chmod 660 /var/run/php5-fpm.sock Open the php5-fpm configuration file […]

Read More