Results 1 to 16 of 16
Thread: Apache2 with php4 and php5
-
11-28-2009, 12:12 AM #1Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
Apache2 with php4 and php5
Hello,
I am looking to work both php4 and php5 with Apache2 in plain server. I have tried most of the links but ended up with no luck
Can you guys tell me how to work on it.
Thanks in advance.
-
11-28-2009, 12:46 AM #2Corporate Member
- Join Date
- Feb 2008
- Location
- Houston, Texas, USA
- Posts
- 3,262
What have you done so far and what issues are you encountering?
Regards
JoeUNIXy - Fully Managed Servers and Clusters - Established in 2006
Server Management - Unlimited Servers. Unlimited Requests. One Plan!
cPanel Varnish Plugin -- Seamless SSL Caching (Let's Encrypt, AutoSSL, etc)
Slow Site or Server? Unable to handle traffic? Same day performance fix: joe@unixy
-
11-28-2009, 12:55 AM #3Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
How do you want each php running? As apache or CGI module?
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
11-28-2009, 01:00 AM #4Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
Thanks for responding Joe
1. Compiled php4 and php5 in various locations with Apache2.
2. Need php4 server wide.
3. Need php5 for particular folder.
4. Add the following to httpd.conf
<Directory /home/user/public_html>
AddHandler php-script .php
Action php-script /cgi-bin/php5
</Directory>
5. cp /usr/local/php5/bin/php /home/user/public_html/
6. restart apache
After all these steps I am unable to work php5 in that particular folder.
Where I am going wrong ??
Thanks in advance.
-
11-28-2009, 01:02 AM #5Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
-
11-28-2009, 01:57 AM #6Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
Thanks for responding Joe
1. Compiled php4 and php5 in various locations with Apache2.
2. Need php4 server wide.
3. Need php5 for particular folder.
4. Add the following to httpd.conf
<Directory /home/user/public_html>
AddHandler php-script .php
Action php-script /cgi-bin/php5
</Directory>
5. cp /usr/local/php5/bin/php /home/user/public_html/
6. restart apache
After all these steps I am unable to work php5 in that particular folder.
Where I am going wrong ??
Thanks in advance.
-
11-28-2009, 02:12 AM #7Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
Add this to the httpd.conf file.
Code:<Directory /home/user/public_html> Action application/x-httpd-php5 "php" AddHandler application/x-httpd-php5 .php5 </Directory>
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
11-28-2009, 02:24 AM #8Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
-
11-28-2009, 03:57 AM #9Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
Add the following line too along with the previous lines.
AddType application/x-httpd-php5 .php5
Restart apache after that.David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
11-28-2009, 04:33 AM #10Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
-
11-30-2009, 07:35 AM #11Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
Hello,
I am still not getting an clear idea how to make it work.
"Php4 as Apache mod and Php5 as CGI" / "php4 as server wide and php5 for particular directory". can any one post me the clean steps how to make it work in plain server.
Thanks in advance.
-
11-30-2009, 01:50 PM #12Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
12-01-2009, 02:44 AM #13Junior Guru Wannabe
- Join Date
- Jul 2009
- Posts
- 57
-
12-01-2009, 09:06 AM #14Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
Compile php5 as follows.
Code:wget http://us.php.net/get/php-5.2.11.tar.gz/from/us.php.net/mirror tar -zxf php-5.2.11.tar.gz cd php-5.2.11 ./configure --prefix=/usr/local/php5 --add_the_remaining_options_from_php4_expect_apxs make make install
Code:/usr/local/php5/bin/php-cgi -v
Now add the following lines on top of the httpd.conf file
Code:ScriptAlias /php5/ /usr/local/php5/bin/ Action application/x-httpd-php5 /php5/php-cgi <Directory "/usr/local/php5/bin/"> Allow from all </Directory>
Open a .htaccess file inside the folder where you need php5 and add the following code to it. Make sure .htaccess support is enabled in your apache configuration.
Code:AddHandler application/x-httpd-php5 .php
See what it shows when the .htaccess line is commented. It should be php4 then.David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
12-02-2009, 12:13 AM #15Web Hosting Master
- Join Date
- Jan 2008
- Location
- St. John's, NL
- Posts
- 2,201
Sounds like you may want the Concurrent DSO patch during EasyApache so that you can run both together as DSOs. A bit of advice though: if you are running a shared server, do not make PHP4 default. It is old, unsupported, and insecure.
Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
LCWSoft - Canada web hosting (based in Newfoundland) since 2007
Servers based in the US and Canada (Uptime Report)
-
12-02-2009, 05:19 AM #16Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
OP said this in his first post. Seems he has a server without a control panel.
Code:I am looking to work both php4 and php5 with Apache2 in plain server
David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
Similar Threads
-
dual php4 & php5 forcing script to use php5
By acctman in forum Programming DiscussionReplies: 1Last Post: 09-09-2009, 11:22 PM -
PHP4 reaching its End Of Life, 4->5 guaranteed transition service (PHP5+PHP4)
By SHTech in forum Software & Scripts OffersReplies: 1Last Post: 07-16-2008, 06:28 AM -
php4 and php5 togethor on apache2 (centos 4.5)
By dinks in forum Hosting Security and TechnologyReplies: 7Last Post: 07-05-2007, 12:35 AM -
run php4 for .php4 files and php5 for .php [httpd.conf]
By SexualChocolate in forum Hosting Security and TechnologyReplies: 2Last Post: 01-29-2007, 09:29 AM -
PHP4 + Apache2 + Windows Error
By Kakashi in forum Hosting Security and TechnologyReplies: 0Last Post: 07-19-2006, 12:56 PM