first you gonna need to backup the conf file in order when you did something wrong, who knows tho?
and then edit them;
dunno wheres the config file located?
just run nginx -t and it will show you wheres the conf file and its content.
now just edit it with the following:
put root YOUR_INDEX_ROOT; at the top and inside of http { params
the purpose is to set it as global root directory.
and within location ~ \.php$ { edit with the following params:
try_files $uri =404; # try to find the file, if fail throw 404 error
#root /data/data/com.termux/files/home/sdcard/www; # this is the root dir of php files
fastcgi_pass unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock; # pass every php file to this server
fastcgi_index index.php; # the index file name
#fastcgi_split_path_info ^(.+\.php)(/.+)$; # ?
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # param for fastcgi to find the script
include /data/data/com.termux/files/home/sdcard/www/nginx/fastcgi_params;
}
okay then save it and if everything's fine you can run php-fpm by just type php-fpm and hit enter in terminal.
note:
you can also set the fastcgi_pass value to a server addr.
but it seems that php-fpm always use socket file in the first place rather than a server addr.
and then edit them;
dunno wheres the config file located?
just run nginx -t and it will show you wheres the conf file and its content.
now just edit it with the following:
put root YOUR_INDEX_ROOT; at the top and inside of http { params
the purpose is to set it as global root directory.
and within location ~ \.php$ { edit with the following params:
try_files $uri =404; # try to find the file, if fail throw 404 error
#root /data/data/com.termux/files/home/sdcard/www; # this is the root dir of php files
fastcgi_pass unix:/data/data/com.termux/files/usr/var/run/php-fpm.sock; # pass every php file to this server
fastcgi_index index.php; # the index file name
#fastcgi_split_path_info ^(.+\.php)(/.+)$; # ?
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # param for fastcgi to find the script
include /data/data/com.termux/files/home/sdcard/www/nginx/fastcgi_params;
}
okay then save it and if everything's fine you can run php-fpm by just type php-fpm and hit enter in terminal.
note:
you can also set the fastcgi_pass value to a server addr.
but it seems that php-fpm always use socket file in the first place rather than a server addr.
Komentar
Posting Komentar