Monday, July 01, 2024

Re: PHP PATH_INFO

First, since OpenBSD 1.0, I try to go by memory, nginx doesn't support webdirs so.. you have to be more creative inside your .conf.
Second, I suggest you to move away "include fastcgi_params;" and go in declarative mode manually tuning what you need.
I further think that due to the position of the include your previous declaration gets overwritten.

-Dan

Jul 1, 2024 19:00:10 F Bax <fbax.ca@gmail.com>:

> browser to mysite.ca/Boards.php[http://mysite.ca/Boards.php] works as expected; but when launched with PATH_INFO as in mysite.ca/Boards.php/SMS[http://mysite.ca/Boards.php/SMS] this presents 404 not found.
>
> A search online produced several pages where PHP script was accessed but $_SERVER['PATH_INFO'] was empty; so they are one step ahead of my situation; since PHP script does not get invoked for me.
>
> Here is portion of /etc/nginx/nginx.conf which I expect needs changing.
>
>          location ~ \.php$ {
>              try_files      $uri $uri/ =404;
>              fastcgi_pass   unix:run/php-fpm.sock;
>              fastcgi_index  index.php;
>              fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
>              include        fastcgi_params;
>          }

No comments:

Post a Comment