Server run on Amazon Linux AMI** (similary to redhat)
I follow the installation from Install PHP-FPM, Nginx, & MySQL on EC2 with Amazon Linux AMI
It's work properly if I call directly from server IP address like 174.129.213.152/index.php
and I can access other file from my domain correctly like http://gamebiz.asia/robots.txt
The problem is when I call php file http://gamebiz.asia
or http://gamebiz.asia/index.php
their result in blank page.
I try change configuration from
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
to fastcgi_pass 127.0.0.1:9000;
and fastcgi_pass localhost:9000;
the result when I call php file is "502 Bad Gateway" and If I remove fastcgi_pass
I got "download" file instead of execute php file
Configuration
conf.d/default.conf
server{
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml|mp3|ogg|wav|aac)$ {
access_log off;
log_not_found off;
expires max;
}
location ~* \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
server_tokens off;
}
sites-available/gamebiz.asia.conf
server {
server_name www.gamebiz.asia;
rewrite ^(.*) http://gamebiz.asia$1 permanent;
}
server {
listen 80;
server_name gamebiz.asia;
root /var/www/html/SpotDiff/Release;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
I try config virtual host and sub-domain follow Installing NGINX and PHP-FPM - Setup for NGINX
they said I need to setup the different UNIX Sockets for PHP-FPM in /etc/php5/fpm/pool.d/
Unfortunately Amazon Linux AMI don't have apt-get and I don't have directory /etc/php5/fpm/pool.d/
and I search for pool.d
but don't know how to get this file and directory.
I end up on change fastcgi_pass
from unix:/var/run/php5-fpm/DOMAINNAME.socket;
to my default unix:/var/run/php-fpm/php-fpm.sock;
but still got blank page
Please help me I struggle with this for 3 whole days. I will appreciate any kind of help. Thank you.