I have used a TKL AMI on an EC2 instance to quickly create a NGINX / PHP box. Details of the image are on the Amazon marketplace.
It mostly works just as I'd expect it to except for a small caveat - I don't seem to have any php-fpm conf available to me. I may or may not have misunderstood what I'd be getting on the box and I'm reluctant to install anything else as I'm trying to keep it as vanilla as possible (for various reasons.)
I have a typical nginx conf which passes php back to fcgi and I have a typical PHP (not fpm) config in a typical php.ini and associated modules (xcache, pdo, etc.)
server {
listen 0.0.0.0:80;
root /var/www/current/app/;
index index.php;
include /etc/nginx/include/php;
try_files $uri $uri/ /forums/index.php?q=$uri;
}
The /etc/nginx/include/php is very simple;
include /etc/nginx/fastcgi_params;
location ~ \.php$ {
# http://forum.nginx.org/read.php?2,88845,page=3
try_files $uri =404;
fastcgi_pass unix:/var/run/nginx/php-fastcgi.sock;
fastcgi_index index.php;
}
As is the /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
PHP is running as a service, so its got something running.
I have no pool config. No children / max requests etc - nothing. It works in that it serves pages, but it falls over when it gets too many connections (even before load is .5.)
What am I missing? Is FCGI not the same as FPM? Do I need to install something else in order to increase available workers and requests?
UPDATE: dpkg -l php5-fpm
shows no package;
un php5-fpm <none>
0 Answers