PHP has been around for a few years now and is a UNIX standards based alternative to ASP -- in that it is embedded within tags and can be used without the need to get other programs to generate HTML and include it.
- Where do I find the system programs I want to use?
- What version of PHP are you running?
- What file extensions do I use?
- PHP documentation
- What restrictions are there on PHP?
- Problems with getting scripts working
- How do I know if the site is broken?
Where do I find the system programs I want to use?
There is a page on this helpsite that explains the location of the various programs that you may wish to call from your script. See here for more information.
What version of PHP are you running?
Version 4.2.2 This version negates the need to also run PHP3, as all PHP3 functionality is backwards compatible in this version.
Some applications you may install that run PHP will be expecting things to work in the "old" way (pre PHP 4.1) that PHP used to work.
What file extensions do I use?
Given the above point about the backwards compatibility of our version, you should really just use .php for your file extensions. However, .php3 and .php4 will also work -- and are just aliases for the same thing in our server configuration.
PHP documentation
The documentation for PHP is available at php.net.
What restrictions are there on PHP?
PHP is subject to the same security and performance as other scripts on the webspace service.
Your scripts will not be able to open network ports to contact remote machines.
All scripts are sandboxed and chrooted. Sandboxing is the restriction of CPU usage that any one script can utilise. If somebody writes a bad script, it can only get so big and then will stop growing. This is a protection measure to ensure the service is not affected by others. Chrooting is what the name suggests - Change Root. Scripts only have access to the necessary programs they have to on the server to be able to function as they cannot get to the system directories or files because as far as they are concerned the root of the server is your own personal webspace area.
The only other restrictions on scripts are the standard acceptable usage restrictions as per the Virgin Media Acceptable Use Policy.
Problems with getting scripts working
Like all other programming languages, PHP is not supported by Virgin Media. This means that, while the languages should work fine, we don't assist you in your coding and will only be able to help you out if your site's config does not work (see below).
If you have any issues with getting your PHP script to work, you should do the following:
- # Examine the error logs for your site. If you login via FTP [and change "up" a directory from your default directory] and look in the logs/today directory, you can access your CGI logs. You can also see them in a browser by logging into self care.
- Debug your code. Download one of the many code debuggers you can get on the web.
- Get onto the newsgroups. Rename your script to be a .txt file and put it in your site's root directory (where you go into when you login via FTP). Post a link to this file in blueyonder.discussion.pwp if you want help from fellow BY users. The best place to start, however, is the external newsgroup alt.php
How do I know if the site is broken?
It is possible (however unlikely) that your site isn't working for some reason. To identify whether this is the case, you should do the following:
- Download the test PHP script test-php.php from here (you can also see the source code here)
- Upload the file to your site
- Browse to the file in a browser
If you get the results of the script's execution in a browser (See a working example) this is many pages of environment variables and configuration information -- then your site is working fine; the problem is with your coding (see above for what to do about this).
If you still get a failure, please report this in the support newsgroup blueyonder.discussion.pwp or contact us.