PHP, also known as PHP: Hypertext Preprocessor, is an open-source scripting language and interpreter. It is used primarily on Linux Web servers to create interactive and customized Web pages and is an alternative to Microsoft Active Server Page (ASP) technology.
When PHP script is embedded within a Web page, the Web server calls PHP to interpret and perform the operations specified in the PHP script.
Web pages with embedded PHP script can use the file extensions .php, .php3 or .phtml (if you have added this mime-type). For simplicity, this FAQ uses ".php" to refer to all PHP-based Web pages.
NetNationís hosting plans all provide support for PHP. Each PHP-enabled domain has its own separate PHP environment that you can control.
At NetNation, PHP is run as a CGI binary. You may be familiar with PHP as an Apache module. NetNation does not run PHP as an Apache module on our shared servers. NetNation supports "mod_php" only on dedicated, unmanaged Linux servers.
If your plan supports PHP, you can request PHP in your AccountManager using the Plan Info module. For details, see the AccountManager User Guide.
If your site is running on a Linux platform, a php.ini file gives you greater control over the PHP environment and the way PHP runs. It enables you to override specific settings and modify the way PHP is built on the server in order to meet your own specifications.
You can configure your own php.ini file and upload it to your cgi-bin directory. If you do this, you should be sure that the version of the php.ini file is compatible with the version of PHP that is running.
NetNation's Linux shared servers and Advantage line of dedicated servers include a PEAR (PHP Extension and Application Repository) installation.
You can use PEAR packages by including the line
include_path = "/usr/local/php/share/pear in your php.ini file.
You can upload your .php files to any directory other than the cgi-bin directory. PHP files uploaded to and called from the cgi-bin directory will produce an internal server error. Only the PHP binary should be stored in the cgi-bin directory.
PHP is compiled by default with MySQL support. One common error with PHP and MySQL results when you attempt to connect to your databases using the host name "localhost." Because your database is stored on a remote database server, using "localhost" causes errors.
There are a number of reasons that your PHP files may not be working properly.
Check that you have requested PHP
Even if you have selected a hosting plan that supports PHP, you must still request PHP in AccountManager. You can check your active features and, if necessary, request PHP using the Plan Info module. For detailed instructions, see the AccountManager User Guide.
Check that you are using the correct version of PHP (Linux platforms)
Check that the cgi-bin and PHP binary have the correct permissions (Linux platforms)
At times, you may make permission changes to your cgi-bin directory and files. If these permissions are not correct, PHP may not operate properly.
To check that the cgi-bin directory and PHP binary have the correct permissions, type the following command: chmod
The permissions must be one of the following:
• 751 (which equates to drwxr-x--x)
• 755 (which equates to drwxr-xr-x)
Check the directives in your php.ini file (Linux platforms)
If you have uploaded a php.ini file and are experiencing problems with PHP, you may want to check what directives are included in the php.ini file. For example, you may be trying to use a feature that has been disabled in the php.ini file.
Check if PHP files are being called from the cgi-bin directory
If .php files have been uploaded to the cgi-bin directory, PHP may not operate properly. Only the PHP binary needs to be in the cgi-bin directory. Calling a .php file from the cgi-bin directory will produce the error "500-Internal Server Error."
© 2003 NetNation Communications