I have some progress and corrections:
* I better understand some of the diferences between php-fpm and spawn-fcgi. spawn-fcgi was a left-over startup script from the older php version it seems. I am now using php-fpm with unix sockets and it's working.
* php-fpm must be -pre-started (unlike spawn-gcgi) together with nginx in order to serve php pages.
I get a lot of error output though, if anyone knows what this is all about>> Starting php_fpm.
[07-Aug-2013 16:52:30] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/apc.so' - Cannot open "/usr/local/lib/php/20121212/apc.so" in Unknown on line 0
[07-Aug-2013 16:52:30] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/curl.so' - Cannot open "/usr/local/lib/php/20121212/curl.so" in Unknown on line 0...
Re my Q2: If you have already defined SCRIPT_FILENAME & PATH_INFO in the nginx/fastcgi_params file, the nginx.conf file becomes very simple. Setting these under each /location becomes unnecessary, as they are already included.
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
given that directory structure is /data/http/folder1, /data/http/folder2, /data/http/folder3, etc.. the config is now:
server {
listen 127.0.0.1:80;
server_name myserver;
root /data/http;
index index.html index.htm index.php;
fastcgi_index index.php;
include fastcgi_params;
location /pub/ {
autoindex on;
}
location /sitebar {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
location /nm/ {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $fastcgi_path_info/nmadmin/$fastcgi_script_name;
}
location /sgw {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
So now my question is modified as:
* Is it necessary to specify the fastcgi_pass in each location, or is it possible to define this elsewhere globally (not all sub-addresses use php)?
* location /nm does not seem to work as its index.php is one folder lower in $document_root/nm/nmadmin. I don't think my modification to SCRİPT_FILENAME is correct in that example.
* I better understand some of the diferences between php-fpm and spawn-fcgi. spawn-fcgi was a left-over startup script from the older php version it seems. I am now using php-fpm with unix sockets and it's working.
* php-fpm must be -pre-started (unlike spawn-gcgi) together with nginx in order to serve php pages.
I get a lot of error output though, if anyone knows what this is all about>> Starting php_fpm.
[07-Aug-2013 16:52:30] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/apc.so' - Cannot open "/usr/local/lib/php/20121212/apc.so" in Unknown on line 0
[07-Aug-2013 16:52:30] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20121212/curl.so' - Cannot open "/usr/local/lib/php/20121212/curl.so" in Unknown on line 0...
Re my Q2: If you have already defined SCRIPT_FILENAME & PATH_INFO in the nginx/fastcgi_params file, the nginx.conf file becomes very simple. Setting these under each /location becomes unnecessary, as they are already included.
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
given that directory structure is /data/http/folder1, /data/http/folder2, /data/http/folder3, etc.. the config is now:
server {
listen 127.0.0.1:80;
server_name myserver;
root /data/http;
index index.html index.htm index.php;
fastcgi_index index.php;
include fastcgi_params;
location /pub/ {
autoindex on;
}
location /sitebar {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
location /nm/ {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $fastcgi_path_info/nmadmin/$fastcgi_script_name;
}
location /sgw {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
So now my question is modified as:
* Is it necessary to specify the fastcgi_pass in each location, or is it possible to define this elsewhere globally (not all sub-addresses use php)?
* location /nm does not seem to work as its index.php is one folder lower in $document_root/nm/nmadmin. I don't think my modification to SCRİPT_FILENAME is correct in that example.