I've tried everything and i can't still get to display errors on the browser, I'm using nginx, php-fpm and centOS 6.4
nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
this is my nginx config inside conf.d
server {
listen 80;
server_name localhost;
root /server/public;
index run.php;
location / {
try_files $uri $uri/ /run.php;
}
location ~ \.php$ {
fastcgi_index run.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
php-fpm config
catch_workers_output = yes
php_flag[display_errors] = on
php_admin_flag[log_errors] = on
php.ini
display_errors = on
log_errors = on
I'm running CentOS 6.4 on virtualbox with NAT enabled, if i curl localhost from inside the server i get the correct error but if i access the site from the browser outside of the server i get a 502 bad gateway error, if the page I'm loading has no errors everything works fine, am I missing anything?
catyour/var/log/nginx/error.logfile and figure out the exact error that the webserver is seeing when you access the system, since a 502 usually means the gateway is not configured right, and withphp5-fpmit usually means you're notfastcgi_pass-ing to the right path