Closed RobertB1 closed 3 years ago
The example configuration is for running Phproject on its own domain at the root path, so may not work in a subdirectory. I haven't tried running it in a subdirectory in a few years, but it should be possible. How to set it up depends on what else you have in that server
block though, it may conflict with any other try_files
directives and needs to be explicitly set to work in your subdirectory.
Something like this may work, but it really depends on your setup:
server {
# ... other non-Phproject location blocks
location ~ /phproject/(.*) {
try_files /phproject/$1 /phproject/index.php?$args;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
}
}
Ideally you'd also want to account for the deny all;
locations in the example configuration, as they can significantly improve the security of the application.
OK, I instaled an exclusive server, put it on the root and it's working. Thank you!
I am trying to install phproject but after I run install.php I’m redirected to http://server/phproject/admin and I get “file not found”.
My config is: Centos 7 up to date PHP 7.4 nginx/1.18.0 MariaDB 10.4
The problem might be something with the url rewrite as described here: https://github.com/Alanaktion/phproject/issues/117 but I don’t know how to solve it on nginx.
I’m using the config file provided, with the extra line: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; which is required in centos for php to work. (By the way, maybe you should add it to the example config).
PHP is working OK. I checked it creating an info page.
Any idea?
Thanks!