What is PHP and how useful is it?
PHP is the acronym used as the common name for Hypertext Pre-processor language, an open-source general-purpose scripting language that is widely used for web developments and can be embedded into HTML. Originally, the term PHP stands for the name Personal Home Page, which is a predecessor program of the Hypertext Pre-processor. PHP can be used to power everything from simple blog sites to the most popular and powerful website because it is known for being fast, flexible and practical and because of its ability to be deployed on most servers as it is known to work on almost all operating platforms, both as a scripting language as well as to enhance web pages. Aside from that, being under PHP License and being open-source, it can be installed and deployed free of charge.
Another characteristic of PHP is that, unlike other scripting languages like C or Perl which uses lots of commands to output HTML, a PHP page already contains HTML with embedded code that is enclosed in a special start and end processing instructions which allows the user to jump in and out of the PHP mode. Another popular description of PHP is that it is a server-side language which means that PHP commands are not executed on your computer but on the computer where you requested the page from. After executing the command, the results are then handed over to you and are displayed on your browser.
PHP is so useful as it can be used to do a lot of things such as the creation of username and password login pages, creation of forums, picture galleries, surveys as well as checking details from a form, among others.
Can PHP work on any server?
Technically speaking, PHP works on all major operating systems such as Microsoft Windows, Max OS X, RIC OS, Linux and many Unix variants like HP-UX, Solaris and OpenBSD. This means that any server using any of the above-mentioned operating systems has PHP support and thus allows PHP to work on them. Aside from this, PHP also supports most web servers today such as Apache and IIS as well as support for servers that can utilize the FastCGI PHP binary including lighttpd and nginx.
Is there a way to detect whether my server has PHP support?
Since not all servers have pre-installed and pre-configured PHP support in them, it is a good practice to check whether your server does have PHP support or not. In order to find out, simply follow the succeeding steps:
- First, create a new file with a .php suffix, say for example checkphp.php.
- Next, type the following code into your file: Code:
and then upload it to your web server using FTP.
- Using your web browser, go to the PHP file, with the URL http://localhost/checkphp.php.
- If your browser displays a page full of information about the PHP version and its configuration including the information about your web server and your system, then your server has PHP support.
- However, if your browser simply displays a blank page, then you’ll know that PHP is not supported by your server.
- After you are through with the checking, do not forget to delete the folder or the file, say checkphp.php, to prevent other people from running the script and obtaining sensitive information about your system.
How can I install PHP if my Windows server does not come pre-installed with it?
Although most Windows server already has PHP installed in them, chances are that some servers do not have PHP pre-installed in it. Should you decide to add PHP support, it is highly recommend that you use the PHP 5 package. To install PHP into your Windows server, you need to follow the succeeding steps:
- First, download PHP from http://www.php.net/downloads.php. Make sure that you select the PHP for Windows. Again, PHP 5 is highly recommended.
- Next, install the file simply by following the instructions. Choose “None” (or other web server). If you are prompted about the type of your web server, choose “I will configure the web server manually” and then proceed with the installation process.
- Open your server’s console and in the “Hosts” table, press “Configure” in the row which corresponds to the host where you want to add PHP support.
- Select “Scripting Parameters”.
- Then check “Enable Scripts Extension”.
- In the Interpreters table, check “Add”.
- In the Interpreter field, press “Browse” and proceed to the directory where PHP is installed and click on “php-cge.exe”.
- Set the type to “Standard” and check the “Use the associated extensions” to automatically update the Script paths.
- In the Associated Extensions table, press “Add”.
- Then enter php in the Extension field and then press “OK”.
- Press “OK” and the Press “Add” in the Custom Environment Variables table.
- Enter “REDIRECT_STATUS” in the Name field and “200” in the Value field and press “OK”.
- In the Scripting Parameter dialogue, press “OK”.
- Select “Index Files”.
- Then press “Add” in the Index Files table and enter index.php in the File Name field and press OK.
- Press the “Restart” button to restart the server.