php5 and php4 at the same time is the same?

bsasninja

Well-Known Member
Sep 2, 2004
527
0
166
I have both php 5 (as main) and php 4 running as cgi.
When a user uploads a script written in php4, apache automatically detects that is php4 and let it run or do I have to specify via .htaccess when is a php4 script??

Thanks
 

ramprage

Well-Known Member
Jul 21, 2002
655
0
166
Canada
If the script is meant for PHP 4 specifically and PHP 5 is the default, the user then must manually specify that 4 runs the script otherwise the default will run it.
 

mohit

Well-Known Member
Jul 12, 2005
553
0
166
Sticky On Internet
use htaccess to declare which php version should be used to parse php files under that a/c.
 

bsasninja

Well-Known Member
Sep 2, 2004
527
0
166
yeah but php4 and php5 extensions are the same (.php)

How the .htaccess should be??

Thanks
 

MattDees

Well-Known Member
Apr 29, 2005
416
1
243
Houston, TX
cPanel Access Level
Root Administrator
You will want to create the following directives in the .htaccess, the first one basically tells a script of ours not to edit this out of the way:


# Use PHP5 as default
AddHandler application/x-httpd-php5 .php


.php4 and .php5 are always parsed by their respective version of php.