im stucked here about 2 days traying to figure out how to make this run, hope somebody could point what I'm doing wrong.
Trying to run Symfony2 over Nginx-CentOS 6 with this configuration file.
upstream phpfcgi {
server 127.0.0.1:9000;
# server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}
server {
listen 80;
server_name symfony2;
root /var/www/project/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
# strip app.php/ prefix if it is present
rewrite ^/app\.php/?(.*)$ /$1 permanent;
location / {
index app.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app)\.php(/|$) {
include /etc/nginx/fastcgi.conf;
fastcgi_pass phpfcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
Obtained from here, here and here. I have been playing arround making little changes here and there, mainly based on what those links tell.
My php-fpm.d/www.conf file is like this...
[www]
listen = 127.0.0.1:9000
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
user = nginx
group = nginx
pm = dynamic
pm.max_children = 50
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 10
pm.max_requests = 500
request_terminate_timeout = 45
request_slowlog_timeout = 45
slowlog = /var/log/php-fpm/www-slow.log
catch_workers_output = yes
security.limit_extensions = .php .php5
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/nginx/tmp/session_php
From navigator i obtain the infamous "No input file specified." error. Logs are like...
[/var/log/nginx/symfony2.error.log]
2015/03/13 12:49:59 [error] 14298#0: *1 FastCGI sent in stderr: "Unable to open
primary script: /var/www/project/web/app.php (No such file or directory)" while
reading response header from upstream, client: 192.168.0.132, server: symfony2,
request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"192.168.0.199"
[/var/log/nginx/symfony2.error.log]
[13-Mar-2015 12:49:59] WARNING: [pool www] child 14279 said into stderr:
"ERROR: Unable to open primary script: /var/www/project/web/app.php (No such
file or directory)"
The project is in /var/www/project and with this set of permissions. Altered by what i read here.
drwxr-sr-x. 5 nginx nginx 4096 mar 10 17:00 app
drwxr-sr-x. 2 nginx nginx 4096 mar 10 17:00 bin
-rwxr-sr-x. 1 nginx nginx 2717 mar 10 17:00 composer.json
-rwxr-sr-x. 1 nginx nginx 100442 mar 10 17:00 composer.lock
drwxr-sr-x. 2 nginx nginx 4096 mar 10 17:00 lib
-rwxr-sr-x. 1 nginx nginx 1065 mar 10 17:00 LICENSE
drwxr-sr-x. 3 nginx nginx 4096 mar 10 17:00 nbproject
-rwxr-sr-x. 1 nginx nginx 5750 mar 10 17:00 README.md
drwxr-sr-x. 3 nginx nginx 4096 mar 10 17:00 src
-rwxr-sr-x. 1 nginx nginx 1308 mar 10 17:00 UPGRADE-2.2.md
-rwxr-sr-x. 1 nginx nginx 1962 mar 10 17:00 UPGRADE-2.3.md
-rwxr-sr-x. 1 nginx nginx 356 mar 10 17:00 UPGRADE-2.4.md
-rwxr-sr-x. 1 nginx nginx 8499 mar 10 17:00 UPGRADE.md
drwxr-sr-x. 3 nginx nginx 4096 mar 10 17:00 web
I already google it a lot and test very different things but none of that seems to work :S. If anyone have any idea im eager to know. Thx in advance.
Edit 1 Checking app.php is there...
stat /var/www/project/web/app.php
File: `/var/www/project/web/app.php'
Size: 960 Blocks: 8 IO Block: 4096 regular file
Device: 802h/2050d Inode: 7997857 Links: 1
Access: (2755/-rwxr-sr-x) Uid: ( 496/ nginx) Gid: ( 493/ nginx)
Access: 2015-03-11 11:10:15.246469137 +0100
Modify: 2015-03-10 17:00:33.026535520 +0100
Change: 2015-03-13 11:55:52.755828687 +0100