Tiger Technologies Technical Support

How do I use PHP scripts?

This page is showing a generic answer. To see a more
specific answer, please type your domain name below:

Our Web hosting service allows you to use scripts created in the PHP programming language.

On this page:

Choosing PHP 4 or PHP 5

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.

Installing a PHP script

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:

  1. 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.)

  2. 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 Web site, you would access it as:

http://www.example.com/search.php

Sending e-mail

If you send e-mail from a PHP script, you'll probably want to make sure your script sets the correct "bounce" address.

What php.ini settings do you use?

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.

Changing basic 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:

Changing advanced php.ini settings

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.)

Can I see the output of phpinfo()?

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.

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.

Search


Related Topics

PHP Versions

Sending E-Mail from PHP Scripts

PEAR Packages

Using HTTP authentication with PHP

Using php_flag or php_value in .htaccess files

Perl Scripts

Unix Shell (telnet and SSH) Access

php.ini Changes That May Not Work As Expected

Zend Optimizer

ionCube Loader

Control Panel Login

Contacting Tiger Technologies