Current time: 11-23-2024, 01:43 PM Hello There, Guest! (LoginRegister)


Thread Closed 
PHP4 or PHP5
Author Message
NetVista Offline
Newbie
*

Posts: 7
Joined: Oct 2006
Reputation: 1
Post: #4
RE: PHP4 or PHP5
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.
07-07-2007 12:13 AM
Visit this user's website Find all posts by this user
Thread Closed 


Messages In This Thread
PHP4 or PHP5 - adigit - 06-30-2007, 10:45 PM
RE: PHP4 or PHP5 - raphael - 07-01-2007, 11:46 AM
RE: PHP4 or PHP5 - adigit - 07-06-2007, 07:44 PM
RE: PHP4 or PHP5 - raphael - 07-07-2007, 03:55 AM
RE: PHP4 or PHP5 - NetVista - 07-07-2007 12:13 AM
RE: PHP4 or PHP5 - adigit - 07-07-2007, 05:38 PM
RE: PHP4 or PHP5 - Quemeros - 05-24-2008, 05:22 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)