To add a new structure out the PHP directory, you have to do first:
- Configure the .ini file
- Add to your IDE the interpretor
A very secure option is to put the PHP parser binary somewhere outside of the web tree of files. In /usr/local/bin, for example. The only real downside to this option is that you will now have to put a line similar to:
#!/usr/local/bin/php
#!
shell-escape mechanism for launching
itself.
To get PHP to handle PATH_INFO and PATH_TRANSLATED information correctly with this setup, the cgi.discard_path ini directive has to be enabled.
To add a new structure out the PHP directory, you have to do first:
- Configure the .ini file
- Add to your IDE the interpretor
You can use binfmt-misc to avoid the need for the #! line, by registering your php5-cgi binary as an interpreter for *.php files. E.g. with Debian binfmt-misc installed:
update-binfmts --install php5 /usr/bin/php5-cgi --extension php
cat /proc/sys/fs/binfmt_misc/php5
However, you still need chmod +x on the .php file. And Apache will give a rather sad "500 Internal Server Error" if you are missing the +x permissions :( You can improve the error message using mod_rewrite (but not obliviate the need for +x)..