What is PHP?

What is PHP?

What is PHP?

PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.

For many users, PHP is an attractive alternative to ASP (active server pages). ASP is not really a language in itself, it’s an acronym for Active Server Pages; the actual language used to program ASP with is a script version of Visual Basic. ASP is said to be a slower and more cumbersome language than PHP, less stable as well.

If you’ve already developed your pages using ASP and would like to convert those pages to PHP, there are free online converters to do it.

PHP and Web Hosts

PHP is installed on most web hosts‘ servers. Please note that most of them do not provide support for this language. For the definitive PHP reference, visit http://www.php.net.

If your PHP scripts are not working, try reinstalling PHP from your Control Panel (where available). That will put a fresh installation of PHP on your account.

To use PHP on your domain, just name your web files with the .php extension (e.g., index.php instead of index.html.) Some servers have both PHP version 3 and PHP version 4 installed. On those servers, if you name your files with the .php3 extension, you’ll invoke the PHP3 interpreter; if you name them with the .php extension, you’ll invoke the PHP4 interpreter.

Viewing Current PHP Configuration

To view the current configuration of PHP on your account, create a php file with the following code (we typically name ours phpinfo.php, but you can name it anything you want, as long as it includes the .php extension):

<title>PHP Info</title>
<?php phpinfo()?>

Upload the file to your www directory, and then point your browser to it; the file will return all relevant details of the PHP installation on your account.

Customizing Your PHP Installation

You can change the default PHP configuration by uploading a customized version of the php.ini file into your cgi-bin directory.

An example of the php.ini file is available below. Download the file that matches your version of PHP, edit it as needed, change the name to php.ini, and then upload it into your www/cgi-bin/directory to override the default configuration. IMPORTANT: Be sure to check your existing PHP scripts to ensure that they still function as expected after uploading the php.ini file!