PDA

View Full Version : PHP 4 to PHP 5 Upgrade


fusionictnl
11-10-2004, 04:09 AM
I've builded this howto from my Fedora Core 1 Machine! Apache 2 Used from DA and all went fine. (Pretty simple)



* Compile the PHP 5 lib for Apache *

- Download php to a temporary directory (http://www.php.net/downloads.php)
- cd [the temporary directory]
- tar zxvf php-5.0.x.tar.gz
- cd php-5.0.x
- /usr/local/directadmin/customapache/configure.php ( _ap2 for Apache2)
- make
- make install

* This was the install procedure * (Check if /usr/lib/apache/libphp5.so exists)

You can copy the php-dist.ini to /usr/local/lib/php.ini and edit for Register Globals on etc. (OR JUST USE THE OLD ONE IF YOU DON'T KNOW WHAT TO CHANGE ;) )

* Configure you're apache (2) *

- vi or pico /etc/httpd/conf/httpd.conf

** On my machine the httpd conf is already altered:

#
# Dynamic Shared Object (DSO) Support
#
LoadModule php4_module /usr/lib/apache/libphp4.so
LoadModule frontpage_module /usr/lib/apache/mod_frontpage.so
LoadModule perl_module /usr/lib/apache/mod_perl.so
LoadModule php5_module /usr/lib/apache/libphp5.so

** QUOTE OUT THE LoadModule php4_module:


#
# Dynamic Shared Object (DSO) Support
#
#LoadModule php4_module /usr/lib/apache/libphp4.so
LoadModule frontpage_module /usr/lib/apache/mod_frontpage.so
LoadModule perl_module /usr/lib/apache/mod_perl.so
LoadModule php5_module /usr/lib/apache/libphp5.so

Restart apache ;) And all should work GREAT! ;)

If it doesn't work! UNQUOTE the LoadModule php4_module and QUOTE the LoadModule php5_module and restart apache ;)

Problems/Successes! can be posted here ;)

GillroY
11-10-2004, 12:41 PM
Just did the whole thing on a WBEL 3.0 server with Apache 1.3.33 and everything went fine.

Only difference with Apache 2 is the changes you'll have to make in the httpd.conf.
I'll just post them in case anyone needs it :)

To make this how to work with apache 1.3.33 change the following:

Comment out:

<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
###<IfDefine HAVE_PHP4>
#AddModule mod_php4.c
###</IfDefine>


And change:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

into:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

At least, that's what I've figured :) Can someone please confirm this, as I'm no real php/apache guru, and I don't want people messing up their servers...

fusionictnl
11-10-2004, 12:58 PM
Originally posted by GillroY
Just did the whole thing on a WBEL 3.0 server with Apache 1.3.33 and everything went fine.

Only difference with Apache 2 is the changes you'll have to make in the httpd.conf.
I'll just post them in case anyone needs it :)

To make this how to work with apache 1.3.33 change the following:

Comment out:

<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
###<IfDefine HAVE_PHP4>
#AddModule mod_php4.c
###</IfDefine>


And change:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

into:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

At least, that's what I've figured :) Can someone please confirm this, as I'm no real php/apache guru, and I don't want people messing up their servers...

I Guess you mean:

And change:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

into:

<IfModule mod_php5.c>
AddType application/x-httpd-php .inc .php .php5 .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

l0rdphi1
11-10-2004, 01:08 PM
Note that Installatron is untested under PHP 5 ;)

Once more of the scripts Installatron installs work under PHP 5 we will begin testing.

Phi1.

fusionictnl
11-10-2004, 01:18 PM
In the PHP manual there's enough info about PHP 4 to PHP 5.

I quote from PHP site:

PHP 5 and the integrated Zend Engine 2 have greatly improved PHP's performance and capabilities, but great care has been taken to break as little existing code as possible. So migrating your code from PHP 4 to 5 should be very easy. Most existing PHP 4 code should be ready to run without changes, but you should still know about the few differences and take care to test your code before switching versions in production environments.

The "few differences" are: http://www.php.net/manual/en/migration5.incompatible.php

So before saying PHP 5 isn't reverse compatible :P All of my scripts and users script work fine.

There are just some minor changes in some functions, but they all still take the PHP 4 way of handling it.

As said before, I don't think much people get in troubles upgrading, as long you use you're OLD php.ini

Korsakoff
11-14-2004, 05:30 AM
Thank you this way works very well!

(step by step by me with the posts of all guys)

# cd /usr/src
# wget http://ch2.php.net/get/php-5.0.2.tar.gz/from/us2.php.net/mirror
# tar zxvf php-5.0.2.tar.gz
# cd php-5.0.2
# /usr/local/directadmin/customapache/configure.php
# make
# make install


Comment out:

<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
<IfDefine HAVE_PHP4>
#LoadModule php4_module modules/libphp4.so
</IfDefine>
...
###<IfDefine HAVE_PHP4>
#AddModule mod_php4.c
###</IfDefine>

Then change:

<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

into:

<IfModule mod_php5.c>
AddType application/x-httpd-php .inc .php .php5 .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

Save & exit (:wq)

Restart your apache server

# /sbin/service httpd restart

Dr-Host
12-04-2004, 03:46 PM
O.k i've did it on one of our servers for now all seems to be working lets hope it will stay this way

thanks for this littel How-to

if there will be any problems I'll let u know



Thanks,
David
Dr-Host.co.il

nettstedet
12-15-2004, 05:26 PM
Working just great now :D

netswitch
12-16-2004, 12:09 AM
is it possible to have php5 execute .php5 files and php4 all the others ?

nettstedet
12-16-2004, 02:37 AM
After upgrading to php 5.0.3 squirrelmail stopped working.

Error message:
Warning: main(../config/config.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/squirrelmail-1.4.3a/functions/global.php on line 16

Fatal error: main() [function.require]: Failed opening required '../config/config.php' (include_path='.:/usr/local/lib/php') in /var/www/html/squirrelmail-1.4.3a/functions/global.php on line 16

Anyone else have this problem or have a fix for it?

Thanks!

fusionictnl
12-17-2004, 05:07 AM
This doesn't look as a php specific error, more like a missing file or wrong configuration of squirrelmail

XBL
12-19-2004, 08:35 AM
It isn't working for me. I do get it installed properly, but after that, php files don't seem to be parsed anymore.

Like: http://themis.openhost.nl/info/phpinfo.php.

I've been fizzeling with the httpd.conf of course. Commented everything out stated in this topic, commented everything with php4 in it out, added the mimetypes without <IfModule mod_php5.c>
...
</IfModule> around it, to no avail.

To go back to php4, I commented everything with php5 out, uncommented everything with php4. But, well, it stoped working.

Anyone has a solution or pointers to solve this problem?

Jochem

jmstacey
12-19-2004, 04:36 PM
Jochem,
Your php info is showing up correctly for me so it appears you solved your problem, (or reverted back to php4?)

XBL
12-19-2004, 11:22 PM
jmstacey: thanks for telling me... I checked it with Internet Explorer (my default browser is Firefox) and it, indeed, is working.

Maybe problems with sending header info, or something? Because with Firefox it's still showing the source in plain text.

Jochem

jmstacey
12-20-2004, 01:50 AM
That's strange, since I was using firefox when I checked.

Just tried it again and its working for both FireFox and Internet Explorer on my side.

Try clearing out the cache. The browser has no jurisdiction over whether server side scripting languages such as php and perl are parsed or show source since that is.... server side.

I have noticed that Firefox likes to keep cached pages around even after multiple refreshes and on pages that should be dynamic (possibly a flaw). I find it really annoying when trying to view changes I've made to a page and nothing happens.

XBL
12-20-2004, 08:57 AM
It was the problem, indeed. Thanks for the help.

I'll tell mozilla about the problem (the caching, even after multiple refreshes), because it's very iritating :P.

Jochem

wdv
12-20-2004, 11:05 AM
Could anyone tell me their experiences with upgrading PHP4 to PHP5. Did any popular scripts break?

fusionictnl
12-20-2004, 12:00 PM
Originally posted by wdv
Could anyone tell me their experiences with upgrading PHP4 to PHP5. Did any popular scripts break?

http://www.php.net/manual/en/migration5.incompatible.php

Only these problems have appeared in upgrading to PHP5.

Most differences are that some minor function returns a boolean instead of nothing (null)

wdv
12-20-2004, 12:03 PM
I heard that for example phpBB breaks with PHP5. Is this true?

fusionictnl
12-20-2004, 01:56 PM
www.phpbb.com ?

wdv
12-20-2004, 02:31 PM
Nevermind

GoranTornqvist
12-29-2004, 02:23 AM
On my freebsd 4.1 box I got this error when running configure.php:
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore
(I installed mysql 4.1 before this)
Solution was to specify --with-mysql=/usr/local/mysql in the configure.php file. After that everything went fine.

I also had to do this in httpd.conf:

Changed:
<IfModule mod_php4.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

To:
<IfModule mod_php5.c>
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

DennisWijnberg
01-20-2005, 04:28 AM
I got an libxml error like this:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
configure: error: xml2-config not found. Please check your libxml2 installation.

It can't find it, the RPM is installed on my OS (CentOS) and there is a /usr/lib/libxml2.so.2 file.

Does someone know how to solve this problem?

GoranTornqvist
01-20-2005, 05:27 AM
Check this out...maybe it will help.
http://www.phpug.de/forum/read.php?f=3&i=893&t=876
http://64.179.4.149/questions/history/247329

DennisWijnberg
01-20-2005, 07:08 AM
Problem was solved, don't use libxml anymore :)
..

Now my Squirrelmail stopped working, get an error message like:

Fatal error: Cannot re-assign $this in /var/www/html/squirrelmail-1.4.2/class/mime/Message.class.php on line 182

Is there a newer version of squirrelmail available to solve this problem?

GoranTornqvist
01-20-2005, 07:29 AM
http://www.squirrelmail.org/wiki/en_US/history/BrowseProblemsByPhpError

check the last entry

Dr-Host
02-17-2005, 06:17 PM
Originally posted by DennisWijnberg
I got an libxml error like this:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
configure: error: xml2-config not found. Please check your libxml2 installation.

It can't find it, the RPM is installed on my OS (CentOS) and there is a /usr/lib/libxml2.so.2 file.

Does someone know how to solve this problem?

I've solved it by updating the libxml to anewer version

jlasman
02-18-2005, 09:35 AM
On CentOS:

# yum update libxml
# yum install libxml-devel

That worked for us.

Jeff

Wunk
05-12-2005, 05:33 AM
I've been trying to get this to work with apache 1.3 on a RH9 machine, but it chokes on the php_flag directive used in virutalhost httpd.conf's


Syntax error on line 27 of /usr/local/directadmin/data/users/backup/httpd.conf
Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration


Any idea how to work around this ?

jmstacey
05-13-2005, 12:53 AM
It could be mod_php is not being loaded properly. Did you make the necassary configuration changes when you upgraded? Such as removing mod_php4 stuff etc?

Wunk
05-13-2005, 03:15 AM
Already found it..

I had to add:
<IfDefine HAVE_PHP5>
AddModule mod_php5.c
</IfDefine>

to make it work :-)

Titam
10-26-2005, 06:32 AM
I did exactly what is write here, i have no error message, but i have no libphp5.so in the directory :\

Is it beaucause i want to run php in CGI mode ? :\

GoranTornqvist
10-26-2005, 07:39 AM
yes...libphp5.so is only if php is compiled as a module/DSO for apache.

If cgi you need:

AddHandler x-httpd-php .php

No AddModule directives in other words...

thats all...i THINK :)

Titam
10-26-2005, 07:42 AM
Ok but what to do with my httpd.conf ... at this time it's a ... problem

test phpinfo :

http://www.testhollinae.com/info.php

That will ask you to download the file lol
Edit : I changed to put mod_php4.c, so now you see the phpinfo ...
But how to know if it's php 5 who is working really and not mod_php4 ?

the part of my httpd.conf


<IfModule mod_php5.c>

# AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
# AddType application/x-httpd-php-source .phps

suPHP_Engine on
AddHandler x-httpd-php .php
AddType application/x-httpd-php .inc .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps

</IfModule>


is-it ok ? i replace the mod_php4.c by mod_php5.c ... there is the problem ?

sky
10-27-2005, 05:42 AM
Hello all :)

Well, i have already done this, but this time, it does not seam to work.

I have this error :
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
configure: error: xml2-config not found. Please check your libxml2 installation.


Well, i just think that i should update or install libxml2 ... but, i have already the version libxml2-2.6.16-2. That should be ok no?

Im on a fedora core 2.

Im trying to udate php to the version 5.0.5.

if you have an idea og how to resolve this problem, thx to you :)

Sky

Titam
10-27-2005, 05:46 AM
I had this problem too, yum says : nothing to do, so, dangerously, i tried up2date libxml2-devel or something like that, and he installed me something, and no more problem after

The_cobra666
02-03-2006, 12:00 PM
Got the same problem. Yum keep saying "nothing to do"

The_cobra666
02-11-2006, 09:21 AM
Any one know's how to fix this problem???

roelp
02-12-2006, 07:57 AM
i had the same problem on Debian
I fixed it by doing:
apt-get install libxml2-dev libxml2

so something like that should fix it on centos

The_cobra666
02-12-2006, 08:48 AM
-bash-3.00# apt-get install libxml2-dev libxml2
-bash: apt-get: command not found
:(

roelp
02-12-2006, 01:09 PM
apt-get is for debian only

CentOS uses yum?

The_cobra666
02-12-2006, 02:56 PM
-bash-3.00# yum install libxml2-dev libxml2
Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 55 kB 00:00
update : ################################################## 137/137
Added 2 new packages, deleted 0 old in 0.24 seconds
primary.xml.gz 100% |=========================| 29 kB 00:00
extras : ################################################## 126/126
Added 2 new packages, deleted 0 old in 0.14 seconds
Excluding Packages in global exclude list
Finished
Parsing package install arguments
No Match for argument: libxml2-dev
Nothing to do
-bash-3.00#

jmstacey
02-12-2006, 03:16 PM
The_cobra666,
If your not using Debian, which appears to be the case, you have to use whatever packaging system is native to your Operating System.

The_cobra666
02-13-2006, 04:55 AM
I'm using Cent OS 4.2, and if I'm right in this topic there are users who have installed it on cent os 4.2, here it stops at the libxml.

koh
02-21-2006, 08:59 PM
im on centos 4.2 too, but I didn't encounter any error when upgrading to php5

jmstacey
02-21-2006, 10:46 PM
The_cobra666,
Didn't we go over this in another thread just recently...?

majglow
02-26-2006, 04:24 PM
I tried to do it on FreeBSD 5. I followed the instructions but I think apache is crashing. It just won't start.

Any ideas?

XBL
02-26-2006, 11:58 PM
Originally posted by majglow
Any ideas? Any errors when starting? Any errors in your logfiles?

Jochem

majglow
02-27-2006, 01:14 AM
Originally posted by XBL
Any errors when starting? Any errors in your logfiles?

Jochem

Nothing except that message that says that the lock file wasn't deleted properly so apache had an unclean shutdown.... basically segmentation faults.

kerrle
02-27-2006, 03:57 PM
I had a similar experience; I used the instructions in the first post, and everything went fine - but apache immediately shut down uncleanly.

It was from having multiple addmodule and loadmodule commands explicitly referencing php4 and 5 in the httpd.conf - thing is, we didn't add anything but the one in the instructions - this conf is more or less the DA one unmodified.

After commenting all but one Loadmodule for php5 out, we got farther, but when it starts processing the individual configs for virtual domains, it complains:

invalid command 'php_admin_flag'

If we comment out those, it will progress to the next user and then have the same problem.

I can comment these out on the users, but these configs were generated by DirectAdmin - is there something I need to do tell it we're using PHP5 or something? I don't want to have to manually change the config every time I add a user, and I'm concerned that upgrading DA might change some of this back.

majglow
02-27-2006, 04:02 PM
Originally posted by kerrle
words

This is for you: http://help.directadmin.com/item.php?id=95

But in my case, I know for a fact that I had all the LoadModule commands for php4 commented out. I was only calling LoadModule for php5.

kerrle
02-27-2006, 05:31 PM
Were you pointing to the section on removing php flags?

This is helpful, and thanks for pointing it out - but I'm still a little concerned as to whether a DirectAdmin upgrade won't re-insert the php loadmodule and other commands in the main httpd.conf.


EDIT:
We got it working now. Still had some stray stuff in the main httpd.conf that we took care of.

NickFritz
02-28-2006, 10:08 PM
Originally posted by netswitch
is it possible to have php5 execute .php5 files and php4 all the others ?

Yes i am looking for this too, if anyone can point me to the correct way to do this that would be great.

jmstacey
02-28-2006, 10:45 PM
Search the forums.

NickFritz
03-01-2006, 06:07 AM
Originally posted by jmstacey
Search the forums.

Everywhere on the forums they mention there are problems doing it as they have not done it yet?

jmstacey
03-01-2006, 12:08 PM
Yes there are problems, however I remember reading a solution that worked for someone else which you could try. I do not have a link.

woyteck
03-13-2006, 07:19 PM
I have got some problems on my freebsd 6 with php5.
After upgrading to php5 my apache2 won't restart properly.
After SIGTERM it uses 99% of CPU.
I must to kill it with -9...

I've upgraded almost strictly as in how-to
(I added pgsql support).

Jinson
03-15-2006, 08:17 AM
Thanks for the guide, fusionictnl. It worked perfectly.

CentOS4 here. Did encounter the libXML error though, when running configure. A simple "yum install libxml2-devel" fixed it, since running rpm -qa "xml" showed that libxml2-devel wasn't installed on my system.

duke28
04-05-2006, 03:23 PM
is it normal after upgrade php4 to php5

when i type ps aux i see it :

/usr/sbin/httpd -DHAVE_PHP4 ....

normal ?

http://www.rapidenet.info/phpinfo.php

all is good ?

neorder
04-06-2006, 07:00 AM
Originally posted by jlasman
On CentOS:

# yum update libxml
# yum install libxml-devel

That worked for us.

Jeff

what is your yum.conf?

i tried yum update libxml, but it was not found. :(

koh
04-06-2006, 07:05 AM
have you tried to

#yum install libxml-devel

it work for me after i install that

neorder
04-06-2006, 07:24 AM
my yum.conf is very simple, i am afraid it doesn't include updated packages, that's why i can't yum upgrade xml.

what is your yum configuration?

koh
04-06-2006, 07:30 AM
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages in testing
[testing]
name=CentOS-$releasever - Testing
baseurl=http://mirror.centos.org/centos/$releasever/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

neorder
04-06-2006, 11:27 PM
thanks dude

i've modified my yum.conf, but still

[root@nagios php-5.1.2]# yum install libxml-devel
Repository testing is listed more than once in the configuration
Repository update is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Setting up Install Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
No Match for argument: libxml-devel
Nothing to do


i'm installing the latest php which is v5.1.2, i have error at the step ./configure_ap2

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

koh
04-07-2006, 12:39 AM
try this

#yum install libxml2-devel

neorder
04-07-2006, 01:25 AM
great, you clever, it worked. thanks. :p

koh
04-07-2006, 03:06 AM
no problem, happen to me too, took me sometime to figured it too :)

yorn
04-24-2006, 08:35 AM
I've got this weird problem, I configured, compiled and installed php successfully (after installing some additional packages with yum). The Apache config was editted by the installer and when I type php -v at the commandline it reports 5.1.2. So nothing to worry about you'd say. But when I restart apache, it won't load again, leaving me with:
Starting httpd: Syntax error on line 97 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/libphp5.so into server: /usr/lib/apache/libphp5.so: undefined symbol: php_stream_xport_unregister

Line 97 contains the line the install script has added:
LoadModule php5_module /usr/lib/apache/libphp5.so

So I commented it, then it complains about this line:
AddModule mod_php5.c
which I commented too.

Apache starts, but phpinfo reports PHP Version 4.4.2

I googled this stuff, but I didn't manage to find any answers.

The server runs on Fedora Core 5

XBL
04-24-2006, 09:04 AM
Appearntly apache has some problems with 'php_stream_xport_unregister' (something you compiled into php?). After commenting the both lines, the old php version is loaded again (and it doesn't load php5... that's why php 4 shows up on a phpinfo()).

Can you show me what compile options you used for php5?

Jochem

yorn
04-24-2006, 09:36 AM
I used the same arguments used in the first post in this topic:
/usr/local/directadmin/customapache/configure.php && make && make install

by the way, I understand why php 5 doesn't load up, I just gave that information so a reader can be sure php 5 doesn't get accidently loaded :rolleyes:

The_cobra666
04-30-2006, 02:12 PM
Now I got this ==>

checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.

Any idea's?

Mr. Jinx
05-05-2006, 09:13 AM
This works great on centos 4.3!
Only had to manually comment out the libphp4 part as described in the first post.

In combination with APC (http://pecl.php.net/package/APC) everything runs very fast now!

BlueVirtual.Com
05-11-2006, 12:05 AM
I was able to upgrade to PHP 5.1.2 and got suPHP working with it as well.

My issue is that when I use the DA admin, reseller or user panel, I see the template variables, along with all the correct items. I have attached a screen shot. Any ideas on how to fix this?

QuantumNet
09-01-2006, 10:13 AM
I have the same problem anyone?

can get PHP5 to work in CLI mode just fine but when I install it as a cgi instead it breaks the Directadmin interface

gcypher
09-28-2006, 12:32 PM
apache complains about:
Syntax error on line 30 of /usr/local/directadmin/data/users/asmande/httpd.conf:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration

in users httpd.conf.
I use apache 1.3.37 php4 (latest)
i changed back to php4 .. anybody has any ideas ? its the line about open_basedir and i dont want to disable it.

Thanks in advance

sEp
10-31-2006, 07:18 AM
Hi there,

When I run this command:

/usr/local/directadmin/customapache/configure.php_ap2


Nothing happens and therefore the rest make, etc do not work. Would there be a solution to this?

/usr/local/directadmin/customapache/configure.php seems to work but does not do anything as I am using Apache 2.

sEp
10-31-2006, 02:50 PM
Nevermind.
I just rolled back to Apache1.3 and now everything is working great.

Thanks for the how-to. ;)

flamegrill
11-20-2006, 03:55 PM
Originally posted by BlueVirtual.Com
I was able to upgrade to PHP 5.1.2 and got suPHP working with it as well.

My issue is that when I use the DA admin, reseller or user panel, I see the template variables, along with all the correct items. I have attached a screen shot. Any ideas on how to fix this?

Thats an easy fix. When you install php 5, the php binary that gets installed isn't php cli, it is php cgi. To fix this, go to:

/usr/local/directadmin/customapache/php-5.1.2/sapi/cli

copy the php file found here over /usr/local/bin/php and it will fix the display problem. Mark or John informed us of this a few months ago during a routine upgrade.

Obviously the path depends on your php version.

Paul

tarquel
12-06-2006, 06:54 PM
Hi all

Followed the initial post and when it has come to restarting the httpd service... i get this:

Syntax error on line 101 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/libphp5.so into server: /usr/lib/apache/libphp5.so: undefined symbol: _zend_hash_add_or_update
[FAILED]


Is there something in the make that failed but i didnt notice the error possibly?

I havent got a particularly complex system. Just wondering what this could be.

Do i have to update zend or something? If so, how :D

EDIT:
Updated Zend first with the ./build zend and then started the process again.

Just to note, but I noticed that it had created some of the manual additions already [unless they were already there - i hadnt checked so wasnt sure]

Anyhow... httpd has restarted now and all is good. phpinfo reports 5.2.0 with all the modules such as gd with freetype etc as installed.

Re-sult :) :)

Cheers
Nath.

jseymour
12-16-2006, 05:05 AM
Originally posted by neorder
what is your yum.conf?

i tried yum update libxml, but it was not found. :(

Thanks for this. The problem is that it is now libxml2. yum install libxml2-devel fixed the error for me.

PHP is upgraded to 5.2.0 and running fine.:)

flumps
02-25-2007, 03:05 PM
im trying to follow the instructions to install php 5 and when Im on the make part i get:

make: *** No targets specified and no makefile found. Stop.

and when I type in make install i get kinda the same but it says:

make: *** No rule to make target `install'. Stop.


any ideas?

when I did the whole /this/that/configure.php part i got:

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

is libxml2 causing the problem?

if anyone could help that would be great thanks.

Chrysalis
02-25-2007, 03:23 PM
make wont work if configure doesnt finish.

you are missing libxml2 if you install that then try configure again.

flumps
02-26-2007, 12:15 PM
all this talk about upgrading to php5 does it still work ok along side direct admin? I suppose it should otherwise so many people on here would not have updated to it I guess?

any complications that I should be aware of?

jseymour
03-24-2007, 07:01 AM
PHP 5.2.0 is working great with directadmin. (I don't think directadmin has any dependency on PHP.) The only issues you could possibly have are with the web applications themselves. If they are actively developed, then they should already be compatible with PHP 5, if not actively developed, I personally would not use them as any security issues would not be addressed either.:)

iron
04-08-2007, 07:41 AM
:/home/admin/temp/php-5.2.1# make install
Installing PHP SAPI module: apache
[activating module `php5' in /etc/httpd/conf/httpd.conf]
Configuration file is not valid. There are sections closed before opened.
make: *** [install-sapi] Error 1


I'm getting this error after typing "make install"
what can it be and how can i fix it ?

Gus
05-19-2007, 07:35 PM
When I get to here:
# /usr/local/directadmin/customapache/configure.php

I get the following:

Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS...

Sorry, I was not able to successfully run APXS. Possible reasons:

1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of /usr/sbin/apxs follows
/libexec/ld-elf.so.1: Shared object "libexpat.so.5" not found, required by "httpd"
apxs:Error: Sorry, no shared object support for Apache.
apxs:Error: available under your platform. Make sure.
apxs:Error: the Apache module mod_so is compiled into.
apxs:Error: your server binary `/usr/sbin/httpd'..
configure: error: Aborting


I'm running FreeBSD 5.4. I've checked and libexpat.so.5 is in the /usr/local/lib directory. Right now, I can't finish configuring php and apache won't start. Anybody got any ideas?

Gus
05-20-2007, 10:11 AM
Never mind, got it fixed now.

CentOS5
05-20-2007, 12:08 PM
Never mind, got it fixed now.How did you fix it?

bithosts
07-14-2007, 09:52 AM
Gona give this a go tonight!

rtaylor
08-10-2007, 01:39 AM
This has been a very helpful thread, so thanks the contributors, I'm now running PHP 5.2.3. http://www.kewlceo.com/smilies/thumbs/thumbsup%5B1%5D.gif

buyverify_com
12-09-2007, 10:16 PM
ive tried installing php 5.2 and it doesn't create libphp5.so everything else seems to go fine

but i don't know what to do... can anyone help?

ITDevil
12-10-2007, 04:20 AM
ive tried installing php 5.2 and it doesn't create libphp5.so everything else seems to go fine

but i don't know what to do... can anyone help?

try doing this to locate libphp5.so file.

$ updatedb

$ locate libphp5.so

Official Tutorial how to update to php5 is located here

http://help.directadmin.com/item.php?id=135

certicek
12-29-2007, 09:32 PM
Hi,
I had the same problem on CentOS 3.3. I have reinstalled libxml2 again and again. PHP5 did not compiling. 2 days smoking head. Then I found that:
http://xmlsoft.org/FAQ (http://xmlsoft.org/FAQ.html#Compilatio) -
# Troubles compiling or linking programs using libxml2

Usually the problem comes from the fact that the compiler doesn't get the right compilation or linking flags. There is a small shell script xml2-config which is installed as part of libxml2 usual install process which provides those flags. Use

xml2-config --cflags

to get the compilation flags and

xml2-config --libs

to get the linker flags. Usually this is done directly from the Makefile as:

CFLAGS=`xml2-config --cflags`

LIBS=`xml2-config --libs`

So I looked for the script and it worked for me.

Greets from Czech.

Good luck!!!

trajcek
06-17-2008, 07:29 PM
Thank you. Works fine - so far.

Updated to PHP Version 5.2.6 !