php4 and php5 together

8 posts / 0 new
Last post
#1 Mon, 09/24/2007 - 13:20
HowardPierce

php4 and php5 together

Ok, I now know enough about Linux and Virtualmin to be able to totally screw it up. A couple of months ago, I decided to get a faster server, run VM on the new server, and move my domains over from the old one.

I ran into problems with it though, as my OS (Fedora 6) uses php5 by default. I saw that via fcgid, I can run both, and pick a default for each domain.

Of course, mind you, I had some domains already running.

I tried to add php4, but then apache wouldn't start when I yum -installed php4, etc.

So, I removed that default version of php5, and put the php4 (fcgid) on the server. Now, in the individual domains I can see php5.fcgid and and php4.fcgid in the fcgi-bin. I looked at those scripts, and each is pointing to a real php4 or php file that if I run --version on, they answer correctly.

The problem is that Virtualmin insists I only have one php available, and so I can't choose.

What the heck have I done to my server? I can't go back now, as there are stores, etc, and I really can only experiment at night. I need to make it work so that future domains don't have the problem.

By the way, the only way I got some of the domains currently running was to edit the php5.fcgi to point the php4 and copied the php.ini where the php5.ini is.

I know this is a mess. :) Please help someone.

Thanks,

Howard.

Mon, 09/24/2007 - 13:42
Joe
Joe's picture

Hey Howard,

When you switch to running mod_fcgid for all of your servers, you can save yourself a lot of trouble by simply disabling mod_php entirely (this is also the source of your "Apache wouldn't start" problem--you can't have both mod_php versions loaded in one Apache, you have to disable at least one of them...this is in the FAQ, though I thought our PHP versions all installed disabled by default, to avoid this problem--I'll have to double check our package for that platform...also, just so we're not chasing red herrings, please make sure your php4 is from our repository and not some other source...there are several php 4 packages out there in other repositories, and none of them are particularly well-suited for running side-by-side with php 5).

<div class='quote'>So, I removed that default version of php5, and put the php4 (fcgid) on the server. Now, in the individual domains I can see php5.fcgid and and php4.fcgid in the fcgi-bin. I looked at those scripts, and each is pointing to a real php4 or php file that if I run --version on, they answer correctly.

The problem is that Virtualmin insists I only have one php available, and so I can't choose.</div>

At least one of these statements is not true. ;-)

You say you removed php5? But running php --version reports it is version 5?

Double check to be sure you're actually using fcgid to run PHP scripts in the server that you're trying to select a version for. Only fcgid or cgi allows multiple PHP versions.

<div class='quote'>By the way, the only way I got some of the domains currently running was to edit the php5.fcgi to point the php4 and copied the php.ini where the php5.ini is.</div>

Now you're just trying to confuse me. I'm not smart enough to keep up with all of this Howard! ;-)

Let's boil it down to one problem at a time. I'm not sure which of these problems is most pressing for you...so I have to ask: What is the most important problem here? We'll fix that one, and then move on from there.

BTW-Don't panic. You don't yet know enough to cause real damage. We'll get you there in time. But these are merely flesh wounds. No arterial bleeding at all.

--

Check out the forum guidelines!

Wed, 09/26/2007 - 05:01 (Reply to #2)
dstavert@ladybug.net

I am a bit confused as well. I have the same issue. I am using a fresh fully updated minimal CentOS 5 and the latest Virtualmin Pro. I made the assumption from reading the &quot;Compare&quot; page that PHP4 and PHP5 were both installed and were switchable via the admin page. A brief scan of the install script doesn't show any php4 install. After searching the forums I found this reference for CentOS 5 for adding php4 http://www.virtualmin.com/index.php?option=com_fireboard&amp;Itemid=77&a... The yum installer showed that they were coming from the virtualmin repo. That install causes apache to seg fault.

So question is &quot;is the script supposed to install php4 and if not where is any information on installing the two.

Wed, 09/26/2007 - 05:41 (Reply to #3)
dstavert@ladybug.net

Just ran through the references in the 71594 post for installing php4. It appears that just installing php4 and php4-pear doesn't cause apache to segfault. Installing any of the other modules referenced (php4-domxml php4-xmlrpc php4-gd php4-mysql php4-postgresql php4-snmp php4-imap php4-mbstring php4-odbc php4-ncurses) causes the segfault.

Wed, 09/26/2007 - 07:14 (Reply to #4)
dstavert@ladybug.net

This is the current list of php stuff on my install.

php-common-5.1.6-15.el5
php4-pear-4.4.7-1vm
php-snmp-5.1.6-15.el5
php-mysql-5.1.6-15.el5
php-mbstring-5.1.6-15.el5
php-gd-5.1.6-15.el5
php-pgsql-5.1.6-15.el5
wbm-php-pear-1.2-1
php4-4.4.7-1vm
php-cli-5.1.6-15.el5
php-pdo-5.1.6-15.el5
php-5.1.6-15.el5
php-odbc-5.1.6-15.el5
php-imap-5.1.6-15.el5
php-pear-1.4.9-4
php-xmlrpc-5.1.6-15.el5

Any of the scripts that need php4 will try to install the missing php4 modules php4-mysql in particular. Even though the install may complete and it shows that the web configuration is applied it does not appear to restart apache (which I thought it would need to do to add php4-mysql) it doesn't appear to. Restarting apache segfaults.

Wed, 09/26/2007 - 12:33 (Reply to #5)
Joe
Joe's picture

The segfault is easy to fix, and avoid.

There's a FAQ about it (but that you're seeing it at all means that my PHP package is not doing what it's supposed to by default, and I'll need to get it fixed). In short: Disable mod_php, for at least one of the versions of PHP. Apache cannot have both PHP4 and PHP5 loaded at once. If you're using mod_fcgid for everything (recommended) you don't even need one mod_php version loaded and it's safe to disable both.

The FAQ covering how to disable one or the other is here:

http://www.virtualmin.com/faq/cat/virtualmin/68/#faq97

--

Check out the forum guidelines!

Tue, 09/25/2007 - 12:51
HowardPierce

My OS is Fedora 6
Webmin version 1.360
Virtualmin version 3.46 (Pro)

I know I said I installed php4, and removed php5, but then the php5.fcgi runs /usr/local/bin/php

Which says (when run with --version)

PHP 5.1.6 (cgi-fcgi) (built: May 9 2007 11:45:58)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

The php4.fcgi runs /usr/bin/php4

Which says (when run with --version)

PHP 4.4.4 (cgi-fcgi) (built: Nov 9 2006 03:43:58)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

Any thing else you need? Somehow the fcgid version of php5 remained somehow.

Thanks,

Howard

btw, if you need to just log in and look at this mess, feel free to email me.

Tue, 09/25/2007 - 22:27 (Reply to #7)
Joe
Joe's picture

<div class='quote'>I know I said I installed php4, and removed php5, but then the php5.fcgi runs /usr/local/bin/php</div>

That aint our PHP. We don't put anything into local, and Virtualmin is probably confused by it.

What are we trying to fix again? I'm getting more confused with every post. ;-)

--

Check out the forum guidelines!

Topic locked