
|
|
Q: How do I run PHP scripts on the department web server?
See the How to run CGI scripts to create the necessary
directories for your php scripts. It is not neccessary to do this if you have already
run makecgi
for cgi script support. Please note that you are only doing this to make directories
and are not setting up suexec support for php. Php scripts do not follow the same rules
as cgi since they are run as the webserver; in other words, a privledge-less user equivalent
to nobody.
Once your environment is set up, the only requirements are...
PHP Version Information
Please note that the CGI/PHP server is running PHP version 4.x. If you require PHP version 5
then there are two options:
- You can
run your PHP by way of CGI. In order to do this create an executable
cgi script with the .cgi file extension (as you would for any cgi script) and then put the
following as the first line in the script to envoke php5:
#!/l/php5/bin/php
After this first line, the rest of the script just contains your normal php source.
When run in this way, php is running per the CGI Suexec model so it is running as your
userid and is not running in safe mode.
- We can configure things so that all .php files in a "PHP5" subdirectory of your cgi-pub directory are
envoked with php5. Setting this up is simple but requires a change in the apache config so just
let us know
if you want to set this up for your account. As with option 1, this results in your .php scripts being processed
per the CGI Suexec model so it is running as your
userid and is not running in safe mode. This option is particulary useful when trying to run 3rd party php5 applications
without having to modify filenames and embedded links.
See an error in this FAQ entry? Please
report it.
[Return to the FAQ index]
|