DirectAdmin Forums

Go Back   DirectAdmin Forums > Announcements > Version Updates > Required Software Version Updates

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2004, 03:09 AM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
PHP 4 to PHP 5 Upgrade

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

Last edited by fusionictnl; 12-20-2004 at 02:35 AM.
Reply With Quote
  #2  
Old 11-10-2004, 11:41 AM
GillroY GillroY is offline
Verified User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 15
Thumbs up

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...
Reply With Quote
  #3  
Old 11-10-2004, 11:58 AM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
Quote:
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>
Reply With Quote
  #4  
Old 11-10-2004, 12:08 PM
l0rdphi1 l0rdphi1 is offline
Verified User
 
Join Date: Jun 2003
Posts: 1,467
Note that Installatron is untested under PHP 5

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

Phi1.
__________________
Installatron Applications Installer gives you and your users an intuitive interface to install, upgrade, and backup/restore a growing collection of web apps. It's a native DirectAdmin plugin and is absolutely FREE for one domain!

Also: cPanel-to-DA converterBulk Domains and Sub-domain PluginDA User Tool
Reply With Quote
  #5  
Old 11-10-2004, 12:18 PM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
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/migrati...compatible.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
Reply With Quote
  #6  
Old 11-14-2004, 04:30 AM
Korsakoff Korsakoff is offline
Verified User
 
Join Date: Aug 2004
Posts: 11
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...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
Reply With Quote
  #7  
Old 12-04-2004, 02:46 PM
Dr-Host Dr-Host is offline
Verified User
 
Join Date: Mar 2004
Location: Israel
Posts: 109
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
__________________
Dr-Host, the Doctor for your hosting needs
Reply With Quote
  #8  
Old 12-15-2004, 04:26 PM
nettstedet nettstedet is offline
Verified User
 
Join Date: Sep 2004
Location: Norway
Posts: 12
Working !

Working just great now
__________________
Thomas

Webhuset AS
Dedikert server - Webhotell - VPS server

Last edited by nettstedet; 12-15-2004 at 07:15 PM.
Reply With Quote
  #9  
Old 12-15-2004, 11:09 PM
netswitch netswitch is offline
Verified User
 
Join Date: Dec 2003
Location: Belgium
Posts: 156
is it possible to have php5 execute .php5 files and php4 all the others ?
Reply With Quote
  #10  
Old 12-16-2004, 01:37 AM
nettstedet nettstedet is offline
Verified User
 
Join Date: Sep 2004
Location: Norway
Posts: 12
squirrelmail

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!
__________________
Thomas

Webhuset AS
Dedikert server - Webhotell - VPS server
Reply With Quote
  #11  
Old 12-17-2004, 04:07 AM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
This doesn't look as a php specific error, more like a missing file or wrong configuration of squirrelmail
Reply With Quote
  #12  
Old 12-19-2004, 07:35 AM
XBL XBL is offline
Verified User
 
Join Date: Nov 2004
Location: Castricum, The Netherlands
Posts: 50
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
Reply With Quote
  #13  
Old 12-19-2004, 03:36 PM
jmstacey's Avatar
jmstacey jmstacey is offline
Verified User
 
Join Date: Feb 2004
Location: Colorado
Posts: 4,111
Jochem,
Your php info is showing up correctly for me so it appears you solved your problem, (or reverted back to php4?)
__________________
Just do what it takes to make it happen
Reply With Quote
  #14  
Old 12-19-2004, 10:22 PM
XBL XBL is offline
Verified User
 
Join Date: Nov 2004
Location: Castricum, The Netherlands
Posts: 50
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
Reply With Quote
  #15  
Old 12-20-2004, 12:50 AM
jmstacey's Avatar
jmstacey jmstacey is offline
Verified User
 
Join Date: Feb 2004
Location: Colorado
Posts: 4,111
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.
__________________
Just do what it takes to make it happen
Reply With Quote
  #16  
Old 12-20-2004, 07:57 AM
XBL XBL is offline
Verified User
 
Join Date: Nov 2004
Location: Castricum, The Netherlands
Posts: 50
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
Reply With Quote
  #17  
Old 12-20-2004, 10:05 AM
wdv wdv is offline
Verified User
 
Join Date: Oct 2003
Posts: 163
Could anyone tell me their experiences with upgrading PHP4 to PHP5. Did any popular scripts break?
Reply With Quote
  #18  
Old 12-20-2004, 11:00 AM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
Quote:
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/migrati...compatible.php

Only these problems have appeared in upgrading to PHP5.

Most differences are that some minor function returns a boolean instead of nothing (null)
Reply With Quote
  #19  
Old 12-20-2004, 11:03 AM
wdv wdv is offline
Verified User
 
Join Date: Oct 2003
Posts: 163
I heard that for example phpBB breaks with PHP5. Is this true?
Reply With Quote
  #20  
Old 12-20-2004, 12:56 PM
fusionictnl's Avatar
fusionictnl fusionictnl is offline
Verified User
 
Join Date: Jun 2004
Location: Netherlands
Posts: 1,055
www.phpbb.com ?
Reply With Quote
Reply

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 can I upgrade php 4 to php 5 jancat CustomBuild 2 03-31-2008 02:07 PM
How to Upgrade PHP4 to PHP 5.2.0 on Apache 1.3.37 tolik777 How-To Guides 16 06-21-2007 12:39 PM
How to Upgrade PHP4 to PHP 5.2.0 on Apache 2.0.59 Server teknobox How-To Guides 2 02-05-2007 04:47 AM
MySQL and PHP 5 upgrade guide asmar Debian 19 10-20-2006 06:21 AM
php Bugfix hostpc.com General Technical Discussion & Troubleshooting 1 03-07-2005 07:05 PM


All times are GMT -7. The time now is 07:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
DirectAdmin © 2007 JBMC Software