
Our Web hosting service allows you to use scripts created in the PHP programming language.
On this page:
Our servers have both PHP 4 and PHP 5 available. Accounts use PHP 4 by default, but you can choose PHP 5 using your account management control panel.
Unlike Perl scripts, PHP scripts can be placed anywhere on your Web site. You don't need to enter any special text on the first line, and you don't need to change the permissions to make them "executable" after uploading them.
To install a PHP script, just be sure to follow these two rules:
For example, you could call a search script "search.php". (If you name a PHP script "index.php" and place it in a directory that does not contain an "index.html" or "index.htm" file, the PHP script will be displayed as the default file for that directory.)
Although text mode is the default for most FTP programs, your PHP script may not work if accidentally uploaded in binary mode, so it's wise to check. Text mode is sometimes called "ASCII mode".
When your PHP script is installed, you'll be able to access it just like any other Web page. For example, if you named your script "search.php" and placed it in the top level of your Web site, you would access it as:
http://www.example.com/search.php
If you send e-mail from a PHP script, you'll probably want to make sure your script sets the correct "bounce" address.
Certain aspects of the way PHP works are controlled through the server's "php.ini" file. By default, we use php.ini settings that are tuned for maximum security. In particular, people who are asking this question are probably interested in these three settings:
allow_url_fopen = "Off" for PHP 4, "On" for PHP 5 magic_quotes_gpc = "On" register_globals = "Off"
(However, for compatibility reasons, allow_url_fopen and register_globals may be "On" for accounts that were established with us before March 2005, even with PHP 4.)
We do allow our customers to change these settings if they wish (but be sure you understand the security implications of enabling allow_url_fopen in PHP 4 or register_globals in any PHP version). See the next sections for more information on changing the php.ini settings.
Our version of PHP allows our customers to override any php.ini settings. This lets us use a global php.ini file that has the settings turned to high security levels, while giving our customers a way to lower those security settings for the few scripts that require it. (In particular, you probably need to turn on the "allow_url_fopen" setting if you see PHP error messages saying "URL file-access is disabled in the server configuration".)
You can easily change the "register_globals", "magic_quotes_gpc", "allow_url_fopen" and Zend Optimizer PHP settings for your account in the customer control panel:
If you need to change php.ini settings other than "register_globals", "magic_quotes_gpc" or "allow_url_fopen", advanced users can do that, too. It involves editing a file in a subdirectory of your home directory.
First, follow the instructions above to use the control panel to set the "register_globals", "magic_quotes_gpc" and "allow_url_fopen" options the way you want them. (You should view the PHP Settings section of the control panel and press Save Changes even if you don't change these settings, because doing that creates the "php.ini" file you're going to edit next.)
After doing that:
The php.ini file only needs to contain the line(s) you want to change from the defaults we use. For example, if you want to turn on PHP's "asp_tags" option, you would need to add only this single line to the php.ini file (leaving any existing lines in place):
asp_tags = On
If you have any trouble, or you don't feel comfortable using the Unix shell, please contact us and let us know what php.ini settings you want to change. We can take care of it for you.
(We should also mention that there are a small number of php.ini settings that can't be changed.)
Certainly. The two versions of PHP use slightly different settings: please see our page about the different PHP versions for more information and links to "phpinfo()" output for each version.
Remember that you can override most of the php.ini settings; the sample pages are useful for showing what modules we have installed and what defaults we use.
PEAR packages are files that contain prewritten PHP code. Some scripts use PEAR packages to perform tasks such as connecting to a database.
We do support PEAR, with many PEAR packages preinstalled. See our PEAR support page for more details.
Zend Optimizer and ionCube Loader allow you to run certain "encoded" PHP scripts. We have instructions explaining how to use them on our Zend Optimizer and ionCube Loader pages.