ispCP - Board - Support
PHP4 or PHP5 - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: PHP4 or PHP5 (/thread-902.html)



PHP4 or PHP5 - adigit - 06-30-2007 10:45 PM

Both PHP4 and PHP5 are installed in ISPCP, how can we know which one the programs are running on?

Is it possible to choose and how?


RE: PHP4 or PHP5 - raphael - 07-01-2007 11:46 AM

well, it depends on what you enable. Check in ispcp.conf for the PHP_VERSION entry; note that no matter if you change it nothing will be affected.

Besides that, you can enable mod_php4/5 and all domains with php enabled will be able to use it


RE: PHP4 or PHP5 - adigit - 07-06-2007 07:44 PM

Quote:nothing will be affected
?

could you tell the ways often used to enable mod_php4/5?


RE: PHP4 or PHP5 - NetVista - 07-07-2007 12:13 AM

usualy in a htaccess file you will find the right directives for php5 usage (activation). As an example there is another way to handle php4 only in the current ispcp release. It was ment for the file manager (net2ftp) that can't run under php5.

Below is a small tutorial

Many shared server environments currently run .php scripts using the PHP4 interpreter and .php5 code using the PHP5 interpreter. Rather than changing all your file extensions, and perhaps breaking many links, use a .htaccess file to dynamically map one extension to the other.

IMPORTANT CAVEAT:One common reason for doing this is that hosts leave PHP4 configured with register_globals ON in order to support legacy code while offering PHP5 with register_globals OFF.

Turning register globals OFF via a local php.ini or a .htaccess file will NOT offer you any extra protection. Another exploited account on your server can simple hack yours. For server security, and since php 4.2, register globals is OFF server wide by default (php default). If you need register globals ON for a specific site, simple use a .htaccess file for that specific directory, and server wide security will not be compromised. Of course, if you do this be sure all effected scripts fully sanitize input data.

Requirements
1. Your Apache server must be configured to use .htaccess files. If not, you must edit the Apache templates for domain and subdomain in /etc/ispcp/apache/parts with AllowOveride All.

Directions
1. Check to be sure your site is configured to use .htaccess files.

2. Make a backup of the .htaccess file in your root htdocs directory. If you don't have a .htaccess file at this location, create one now.

3. There are various ways to set the command, depending on your server configuration. One of the following will probably work. Add ONE the following lines at the end of your .htaccess file. If unsure which to use, or what to do better ask questions in this forum.

Code:
AddType x-mapp-php5 .php
AddHandler application/x-httpd-php5 .php
AddHandler cgi-php5 .php

4. Carefully test.

5. Delete the backup .htaccess file. Don't leave backups of .htaccess files in public directories.


RE: PHP4 or PHP5 - raphael - 07-07-2007 03:55 AM

adigit Wrote:
Quote:nothing will be affected
?
If you edit the PHP_VERSION var the fastcgi loader won't be modified
adigit Wrote:could you tell the ways often used to enable mod_php4/5?

a2enmod mod_php[4|5]
but make sure they parse .php4/.php5 files, otherwise you will get an error. Or, enable the module but make sure by default it doesn't hook to any file (default is .php) and enable it in a per-domain basis (by editing sites-enabled/ispcp.conf)


RE: PHP4 or PHP5 - adigit - 07-07-2007 05:38 PM

Thanks, raphael!


RE: PHP4 or PHP5 - Quemeros - 05-24-2008 05:22 AM

Sorry, but, this is actually (RC4) need it to change from php5 to php4 in only 1 site?
This http://www.isp-control.net/documentation/frequently_asked_questions/how_can_i_change_to_php4 don't work only with a RC4 out box?