PHP SSI with NGINX
May 21, 2013 in answer
ANSWER:
The line:
is equivalent to calling the function virtual(/some_file.php) which is an Apache specific extension to PHP.
Because of this you can’t just migrate the site across without touching any source code.
If you still want to migrate the site to Nginx I would recommend the following process:
-
Replace every line
with the functionvirtual()equivalent and check that the existing site is still working on Apache. -
Migrate the site config across to Nginx so that it is running at all. Because you have PHP functions in your HTML files, the HTML files will need to be passed through to PHP to be compiled and run (which may defeat half of the point of migrating to Nginx).
-
Implement your own version of the
virtual()function and inject it into every script, using the ability of php to prepend every requested file, by adding in your PHP-FPM config file:php_value[auto_prepend_file]=/home/intahwebz/php_shared/prepend.php
Theoretically then, your site should now be able to run behind Nginx. However if there are other hiccups the site will still run under Apache so could still be deployed under that at any time.

New Comments