Installing a PHP script

To install a PHP script, just follow these two rules:

Name your PHP script so that it ends in ".php". 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.)

Use your FTP program to upload the script file in text (or "ASCII") mode, not "binary" mode. 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".

Using the script you installed

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 website, you would access it as:

PHP memory limits

Our default PHP memory_limit is 500 MB of RAM for PHP 5.6 and later. In the unlikely event that your PHP script requires more than that, you can increase it by placing this type of line in the "php.ini" settings:

memory_limit = 600M

However, you won't be able to increase it beyond the individual script memory limit shown on our Script Policies page — and in fact, it should be at least 100 MB less than shown there, because PHP itself uses some memory. If you try to go beyond that, the server will silently "kill" your script. It's better to keep the PHP memory_limit lower so that PHP shows a useful error message if a bug causes your script to use too much memory.

Can I use PEAR packages?

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.

Can I use Zend Optimizer or ionCube Loader?

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.