After successfully compiling the installation Nginx 1.4, PHP 5.4 on centos6.4 x86_64, after successfully starting Nginx and PHP-FPM, access the PHP prompt error and see in the error log:
Primary Script Unknown ...
Where the Nginx configuration fragment is as follows:
code is as follows |
copy code |
location. php$ { root / Roottowebfolderpath; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename /roottowebfolderpath/$fastcgi _script_name; include Fastcgi_params; } |
The above configuration is working correctly under Nginx 1.2, PHP 5.3. So the suspicion is that other places are misconfigured, some toss, the problem is still, again online search, see one of the articles mentioned Fastcgi_param configuration is not used to feel the path, but the use of variables ($document _root) way. Attempt to modify configuration to:
The code is as follows |
Copy Code |
Location ~. php$ { Root/roottowebfolderpath; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; }
|
At this time nginx, PHP normal work. Note: The fastcgi_param differences in the above two configurations