#1  
Old 10th February 2006, 13:05
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,256
Thanks: 212
Thanked 648 Times in 294 Posts
Send a message via Skype™ to Hans
Question php5 and php4 at the same time

I have read this "how to" with great interest:

http://www.howtoforge.com/apache2_with_php5_and_php4

I have a question about it:

Is it possible to add this as a little extra to a server running Debian 3.1 according "the perfect setup" including ISPConfig?

Or do i have to do this in another way?
Reply With Quote
Sponsored Links
  #2  
Old 10th February 2006, 14:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Quote:
Originally Posted by Hans
Is it possible to add this as a little extra to a server running Debian 3.1 according "the perfect setup" including ISPConfig?
Yes, but I'd then put
Code:
AddHandler php-script .php4
Action php-script /cgi-bin/php4
into each Vhost seperately (using the Apache Directives field of ISPConfig) because otherwise PHP4 is always on (for every web site).
Also check the PHP5 configuration: PHP5 should not be enabled globally, so you must change /etc/apache2/mods_available/php5.conf (otherwise PHP5 is enabled for every web site, no matter what you specify in ISPConfig).
__________________
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
  #3  
Old 15th February 2006, 00:23
gog gog is offline
Junior Member
 
Join Date: Feb 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've done it just today. I had a stable debian sarge system, running apache2, mysql-4.1, and php4 (all the modules installed in "the perfect setup").

I've decided to let php4 run like apache2 module, as it is in "the perfect setup", and I just wanted to add php5 as a cgi.

I just ran:

apt-get install php5-cgi

Then I had to edit my "httpd.conf" file, or better to say one virtaul host's directives. A added a line in one of the <VirutalHost...> entries:

Code:
AddHandler php-scriptt .php
Action php-scriptt /cgi-bin/php5
Notice the 2 tt's in the config file!!! I had to do it this way cause otherwise php4 always parsed the file in that directory, even when I tried to use .php5 extension.

I also added "Options +ExecCGI" to that directory, just in case, not shure if it's really needed.

This works like a charm, a can set php4/php5 on "per virtualhost" bases, or even per directory if I want to. Also, I don't need to change extension and do a search&replace on every skript that needs to be in PHP5. Not to mention the trouble you have to go, upgradeing one og these scripts...

It's kinda late now, have to catch some sleep I just need to install a cople more things, I want to install

Code:
apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy
(I'm not touching any php4 modules)

but I get a warning

Code:
The following packages will be REMOVED:
  php4-dev php4-pear
Hm, what to do? I would really like to leave pear repository for php4...

Last edited by gog; 15th February 2006 at 00:25.
Reply With Quote
  #4  
Old 15th February 2006, 09:32
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Quote:
Originally Posted by gog
It's kinda late now, have to catch some sleep I just need to install a cople more things, I want to install

Code:
apt-get install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-mysql php5-mysqli php5-odbc php5-pdo-mysql php5-pdo-sqlite php5-pear php5-pspell php5-snmp php5-sybase php5-tidy
(I'm not touching any php4 modules)

but I get a warning

Code:
The following packages will be REMOVED:
  php4-dev php4-pear
Hm, what to do? I would really like to leave pear repository for php4...
If you want to keep Pear for PHP4, then don't install the Pear package for PHP5 (php5-pear).
__________________
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 15th February 2006, 09:46
gog gog is offline
Junior Member
 
Join Date: Feb 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yep, that's it. It work great! Maybe you should think of rewriting your original article? Or would you like me to write a new article "PHP5 extends The Perfect Setup - Debian Sarge (3.1)" ?
Reply With Quote
  #6  
Old 15th February 2006, 20:46
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Quote:
Originally Posted by gog
Maybe you should think of rewriting your original article?
Why should I rewrite it? It's working...
__________________
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
  #7  
Old 21st October 2008, 14:01
schmidtedv schmidtedv is offline
Senior Member
 
Join Date: Jun 2006
Location: Germany, Kaarst
Posts: 152
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to schmidtedv Send a message via Skype™ to schmidtedv
Default

Quote:
Originally Posted by falko View Post
Yes, but I'd then put
Code:
AddHandler php-script .php4
Action php-script /cgi-bin/php4
into each Vhost seperately (using the Apache Directives field of ISPConfig) because otherwise PHP4 is always on (for every web site).
Also check the PHP5 configuration: PHP5 should not be enabled globally, so you must change /etc/apache2/mods_available/php5.conf (otherwise PHP5 is enabled for every web site, no matter what you specify in ISPConfig).

I got ISPConfig 2.2.27 and Debian Etch (php5) out of the Perfect HowTo and now just installed php4-cgi and some modules without a problem. If I give it a try and just put

Code:
AddHandler php-script .php4
Action php-script /cgi-bin/php4
into my vhosts-config and restart apache, i get an error by testing info.php4. Others like info.php still run on php5 so far. If I change this to

Code:
AddHandler php-script .php
Action php-script /cgi-bin/php4
just for testing it runs the info.php4 but on php5....is there something wrong or else to do within debian etch to just get php4 working on testscripts?
Reply With Quote
  #8  
Old 22nd October 2008, 13:02
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,721 Times in 2,562 Posts
Default

Any errors in Apache's error log or the web site's error log?
__________________
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
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
How to upgrade PHP4 to PHP5 Jeroen Server Operation 14 10th November 2006 16:54
Suse 9.3 setup probs with php5 hyperclock Tips/Tricks/Mods 0 21st September 2005 02:34
Installing PHP4 ProTrooper Installation/Configuration 10 29th August 2005 20:20


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


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