Question about root path for php-fpm

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


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20200319/e6902dc1/attachment.htm>


More information about the nginx mailing list