Welcome! Log In Create A New Profile

Advanced

Question about root path for php-fpm

Mahmood Naderan
March 19, 2020 01:46PM
Hi
I am following a document but something seems to be a typo and I want to be
sure about that.

1) It says:
In the webserver root directory, we will install the Olio PHP application,
we will call this directory $APP_DIR:
o cd /webserver/root/dir (e.g. /home/username/htdocs/ created when we
installed Nginx).


So, I set
location / {
root /home/ub/htdocs;
index index.html index.htm;
}




2) It says:
The nginx.conf configuration file must be set with the correct port number
to access PHP-FPM. Open the file nginx.conf and make sure the following
lines exist:
location ~ \.php$ {
root /path/to/root (e.g /home/username/htdocs/public_html );
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $APP_DIR/$fastcgi_script_name; (e.g.,
/home/username/htdocs/public_html/$fastcgi_script_name)
include fastcgi_params; }



Currently, I have this folder structure

$ ls ~/htdocs/
build.xml classes controllers etc includes index.html lib
public_html views
$ ls ~/htdocs/public_html/index*
/home/ub/htdocs/public_html/index.php


If I open browser and enter localhost, I can see the content of
~/htdocs/index.html. So, the first step is fine.


The fastcgi_param says $APP_DIR. So, I should write /home/ub/htdocs but the
"e.g." part says /home/ub/htdocs/public_html

I am not sure if the root in the second step is /home/ub/htdocs or
/home/ub/htdocs/public_html
?


Can someone help. Thanks.



Regards,
Mahmood
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Question about root path for php-fpm

Mahmood Naderan March 19, 2020 01:46PM

Re: Question about root path for php-fpm

Francis Daly March 20, 2020 10:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready