Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th March 2007, 04:58
talwar_ talwar_ is offline
Junior Member
 
Join Date: Mar 2007
Location: Perth, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to talwar_ Send a message via MSN to talwar_ Send a message via Skype™ to talwar_
Question Trying to get PHP and PHP5 work with Apache2

Plz excuse the thread title.. i said "php and php5" instead of "php4 and php5"!

I recently followed the howtoforge article on setting up php4 and php5 on Sarge. (http://www.howtoforge.com/apache2_with_php5_and_php4)

Everything seemed to work during the setup except that i couldnt install all the packages - it could not find some (e.g. php5-pdo-mysql). anyway, i carried on with the instructions and this is my problem:

.php files are correctly being handled by the apache2 handler, i have verified this by using the phpinfo() function. However when i try to browse a .php4 extension i get "object not found" (HTTP 404)

it is as though apache2 doesnt know what to do with .php4 files, even though i have added the following lines to apache2.conf:

AddHandler php-script .php4
Action php-script /cgi-bin/php4

heres what i have currently installed for php4 and php5:

~# apt-show-versions | grep php
php4-cgi/sarge uptodate 4:4.4.6-0.dotdeb.2
php4-pgsql/sarge uptodate 4:4.4.6-0.dotdeb.2
php4-common/sarge uptodate 4:4.4.6-0.dotdeb.2
libapache-mod-php5/sarge uptodate 5.2.1-0.dotdeb.1
php5-common/sarge uptodate 5.2.1-0.dotdeb.1
php4/sarge uptodate 4:4.4.6-0.dotdeb.2
libapache2-mod-php5/sarge uptodate 5.2.1-0.dotdeb.1

any suggestions? thanks in advance!
Reply With Quote
Sponsored Links
  #2  
Old 26th March 2007, 10:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

If you have not installed the packages, the setup can not work. Please make sure that you added the lines for dotdeb to your sources list and ran

apt-get update

afterwards without errors.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 26th March 2007, 11:09
talwar_ talwar_ is offline
Junior Member
 
Join Date: Mar 2007
Location: Perth, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to talwar_ Send a message via MSN to talwar_ Send a message via Skype™ to talwar_
Default

I had already added the dot deb sources to my sources.list before doing anything. I did also run apt-get update before updayting php4 and installing php5.

One thing to note is that i am using virtualmin to manage virtual hosts in Apache2.

When i tell virtualmin to make my test virtual host use CGI for PHP it uses PHP4. If i then set virtualmin to make the virtual host use apache2 mod_php i get served by PHP5.

ive verified the above by browsing to test pages which contain calls to the phpinfo() function.

so what i am trying to achieve is .php served by php5 via apache2 mod and .php4 served by php4 using CGI.

Maybe I have to add the custom handlers to the individual virtual host config file?
Reply With Quote
  #4  
Old 27th March 2007, 16:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Quote:
Originally Posted by talwar_
Everything seemed to work during the setup except that i couldnt install all the packages - it could not find some (e.g. php5-pdo-mysql).
Which packages are missing exactly?

Can you post your vhost configuration?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 28th March 2007, 02:41
talwar_ talwar_ is offline
Junior Member
 
Join Date: Mar 2007
Location: Perth, Australia
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to talwar_ Send a message via MSN to talwar_ Send a message via Skype™ to talwar_
 
Default

managed to fix it up in the end! i think php4-cgi was missing. thanks for the assists!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php5 and php4 at the same time Hans Installation/Configuration 15 22nd October 2008 14:02
ubuntu ispconfig joomla .htaccess steve1084 General 8 6th January 2007 16:55
PHP & MsSQL just wont work. matthewjamesnewotn Server Operation 1 3rd January 2007 21:12
eaccelerator installation - can't find php5-config tom Programming/Scripts 9 15th May 2006 16:36
How to compile apache2 with PHP 5.x.x? tom Server Operation 1 5th May 2006 12:49


All times are GMT +2. The time now is 10:16.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.