Home  |  Helpdesk  |  Server Status  |  Server Annoucements Mailing Lists
 
View Entry
   
Subject PHP5? Yes!
Author HelpDesk Staff
 

At ET Web Hosting, we have installed PHP 5 on our server fleet alongside PHP4. This means you can use both versions of php on all our servers.. even at the same time, on the same account!

TO SET YOUR ACCOUNT DEFAULT TO PHP 5 OR PHP 4

Your cPanel control panel allows you to easily control how .php files in your account should be executed. (Either PHP 4 or PHP 5).

  1. Login to your cpanel control panel. ie: http://www.yourdomain.com/cpanel

  2. Under the "Software" section, click the link called "PHP Configuration" link.

  3. At the top of this page, you can choose how the '.php' file extension will be processed.

  4. Choose either PHP 5 or PHP 4 from the drop down box, and then click the Update button to save your change.

TO USE A DIFFERENT VERSION OF PHP FOR ONLY SOME FILES IN YOUR ACCOUNT

Let's say that PHP 5 is the default for your account, but you have a few files that need to run under PHP 4. No problem!

The way this works is that you need to first give your special files a unique "file extension" so that the server can tell them apart from the other .php files. (Or see the "tip" below.). Then you simply tell the Apache web server software how to treat files that have that file extension. So let's say that you want your ".php4" files to be handled by PHP 4. You would need to simply create an .htaccess file in your website root folder (/public_html/) with the following inside it:

AddType application/x-httpd-php4 .php4
AddHandler application/x-httpd-php4 .php4

Helpful Tip

Remember that .htaccess files will "effect" the folder they are in as well as any folders under them. So.. if you wanted to run PHP4 only for files inside a folder called "php4-files", then you would simply create that folder and put the special .htaccess file inside that folder. Now only files inside that folder and any folders under it will use PHP4 -- and everything else (above that folder) will continue to use PHP5 (or whatever default you have configured for your account).

Using this "per folder" technique, you could set your .php files inside the special folder to run with PHP 4 instead of having to rename them to something like .php4.. In this case, you would put the following lines into the .htaccess file:

AddType application/x-httpd-php4 .php
AddHandler application/x-httpd-php4 .php

As always, if you have any questions about anything please feel free to drop a ticket into the helpdesk and the technicianss will get back to you right away. http://helpdesk.etwebhosting.com

Remote Desktop Viewer