Monday, July 01, 2024

PHP PATH_INFO

I'm working on migrating a website from very old OpenSBD 4.5 to 7.5

I got nginx & php mostly working in chroot environment.

browser to mysite.ca/Boards.php works as expected; but when launched with PATH_INFO as in 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;
         }

Thanks for any suggestions to resolve this.

No comments:

Post a Comment