I'm using nginx on centos 7 with php 5.4.16. I have tried this to adding nginx.conf:
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
But there is no sucha file at: /var/run/php5-fpm.sock Also php funcion works without any problem at terminal. But when I send request to php file from web, the output is the raw php code. What should I do?