Question about root path for php-fpm

Mahmood Naderan mahmood.nt at
Thu Mar 19 17:44:15 UTC 2020

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_index index.php;
fastcgi_param SCRIPT_FILENAME $APP_DIR/$fastcgi_script_name; (e.g.,
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*

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

Can someone help. Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list