File Not Found when running PHP with Nginx

后端 未结 15 1977
后悔当初
后悔当初 2020-12-04 13:59

Recently I installed the latest version of Nginx and looks like I\'m having hard time running PHP with it.

Here is the configuration file I\'m using for the domain:<

15条回答
  •  被撕碎了的回忆
    2020-12-04 14:47

    my case: I used relative dir

           location ~* \.(css|js)\.php$ {
    
                root ../dolibarr/htdocs;
    
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    
                fastcgi_param SCRIPT_NAME $fastcgi_script_name;
                fastcgi_index index.php;
    
                 include /etc/nginx/fastcgi_params;
           }
    
    

    this line did not work too : fastcgi_param SCRIPT_FILENAME /vagrant/www/p1/../p2/htdocs/core/js/lib_head.js.php;

    So I discovered fastcgi_param does not support relative path.

    This works

    fastcgi_param SCRIPT_FILENAME /vagrant/www/p2/htdocs/core/js/lib_head.js.php;
    

提交回复
热议问题