Web Hosting Talk







View Full Version : PHP Upgrade questions?


djlightning
07-18-2002, 01:59 PM
I am wanting to upgrade my current version of php to 4.2. Anyone have some suggestions on what would be the best way to do this?
Should I do from the source or can I use a rpm??
And do I need to recompile Apach and mysql after all this is done?

Any help would be great,
Thanks

cyrusTvirus
07-25-2002, 05:43 AM
how did you install it in the first place ?? From *.pkg, source or rpm ??

blacknight
07-25-2002, 06:54 AM
[QUOTE]Originally posted by djlightning
I am wanting to upgrade my current version of php to 4.2. Anyone have some suggestions on what would be the best way to do this?
Should I do from the source or can I use a rpm??
And do I need to recompile Apach and mysql after all this is done?

Any help would be great,
Thanks [/QUOTE
There's nothing to stop you from upgrading from source.
The steps are quite simple really.
1. Create a phpinfo page. At the top of the page you'll see the .configure command with all the various options. Save this page to your desktop.

2. SSH into your box. Create a temporary directory somewhere
Make a backup copy of your current php.ini
3. wget the latest sourcecode from php.net
su followed by root password
gunzip php***.tar.gz
tar -xvf *.tar
cd php*
./configure --with- (copy and paste the entire thing from your phpinfo page)
Go drink cup of coffee
Check output - you might need to add a couple of paths etc
make
make install
there are two versions of the php.ini available in your working directory. Choose the one you prefer and copy it to /etc/httpd/
Restart Apache /etc/rc./init.d/httpd restart
Check your new phpinfo page against your old one and make any necessary changes in the php.ini (dojn't forget to restart Apache)
NB: The latest versions of Php have register_globals turned off by default - you'll probably need to switch them on

To answer your other question - you don't need to do anything with Apache or MySQL

Sainthax
07-25-2002, 01:01 PM
I copied everything off the info page and tried to configure but it tells me it can't find "gd" under the /usr directory, I've tried this about 4 differant ways also telling it the location of "gd" still comes up with more or less the same error :(

blacknight
07-25-2002, 01:08 PM
Originally posted by Sainthax
I copied everything off the info page and tried to configure but it tells me it can't find "gd" under the /usr directory, I've tried this about 4 differant ways also telling it the location of "gd" still comes up with more or less the same error :(
Are you sure that gd is in the /usr directory ? It might not be.

Sainthax
07-25-2002, 02:04 PM
it's actualy under /usr/local but I tried pointing it there as well with no luck


> locate libgd
/usr/doc/python-docs-1.5.2/Doc/libgdbm.tex
/usr/lib/libgd.so
/usr/lib/libgdbm.so.2
/usr/lib/libgdbm.so.2.0.0
/usr/lib/libgds.a
/usr/lib/libgds.so.0
/usr/lib/libgds.so
/usr/lib/libgds_pyxis.a
/usr/lib/libgdbm.a
/usr/lib/libgdbm.la
/usr/lib/libgdbm.so
/usr/lib/libgds.so.0.orig
/usr/lib/libgd.so.1.8
/usr/lib/libgd.so.1.8.4
/usr/lib/libgd.so.1

blacknight
07-25-2002, 03:07 PM
looks like /usr/lib from what you've posted

Sainthax
07-25-2002, 03:59 PM
it's been a long day :(
I forgot how to write my name with a pen and paper earlier :rolleyes:

anyway I would assume that when I copied the info from my phpinfo page it would work out ok but no matter what I point gd to it says it can't find it

blacknight
07-25-2002, 05:14 PM
I had a similar problem with my own upgrade... you might want to have a look at:
http://www.uk2raq.com/raqfaq/raqfaqshow.php?faq=43

I wouldn't follow it to the letter, as the configuration might not be exactly what you want, but it does include the links to a lot of the RPMs you might need.

Sainthax
07-25-2002, 06:20 PM
I'm gonna stop before I break something I managed to get past my other problem and I end up with another error...oh well time to go home

gd.c: At top level:
gd.c:3402: parse error before `gdIOCtx'
gd.c: In function `_php_image_bw_convert':
gd.c:3407: `im_org' undeclared (first use in this function)
gd.c:3433: `threshold' undeclared (first use in this function)
gd.c:3443: `gdImageWBMPCtx' used prior to declaration
gd.c:3443: `out' undeclared (first use in this function)
make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/home/tmp/php-4.2.2/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tmp/php-4.2.2/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tmp/php-4.2.2/ext'
make: *** [all-recursive] Error 1
[root php-4.2.2]#

blacknight
07-25-2002, 06:25 PM
Stupid question:
Do you really need GD support?

Sainthax
07-25-2002, 06:38 PM
yeah, if I remember correctly Webalizer uses it

blacknight
07-25-2002, 06:47 PM
Originally posted by Sainthax
yeah, if I remember correctly Webalizer uses it
Webalizer may use the library, but it's written in C, so it doesn't seem to have any connection with PHP.

I just checked my own PHP config - no GD, but webalizer seems to be working fine.

Sainthax
07-25-2002, 07:00 PM
[crosses fingers]I'm gonna try compiling without GD then[/crosses fingers]

blacknight
07-25-2002, 07:08 PM
Originally posted by Sainthax
[crosses fingers]I'm gonna try compiling without GD then[/crosses fingers]
If it doesn't work you can reinstall GD and recompile PHP ....
who knows???
Now if I could get Apache and Tomcat 4 to comunicate properly I'D BE HAPPY!

Sainthax
07-25-2002, 07:24 PM
well its installed and running but I can't find this line :confused:
I don't wanna restart apache till I figure out where this line is or if it needs to be added

Find the following line in srm.conf
#AddType application/x-httpd-php .phtml
After it, add this line
AddType application/x-httpd-php .php .php4 .phtml

Sainthax
07-25-2002, 07:44 PM
couldn't find anything to do with that line, restarted apache and everything seems to be working ok

Thank you for you help blacknight :)

blacknight
07-25-2002, 07:49 PM
Originally posted by Sainthax
well its installed and running but I can't find this line :confused:
I don't wanna restart apache till I figure out where this line is or if it needs to be added

Find the following line in srm.conf
#AddType application/x-httpd-php .phtml
After it, add this line
AddType application/x-httpd-php .php .php4 .phtml
I had a look in mine and it's not there either. You don't need it because it's already added for each virtual host in httpd.conf

blacknight
07-25-2002, 07:58 PM
Originally posted by Sainthax

Thank you for you help blacknight :)
Glad I could help you :)
I've got a lot of help from here over the past few months - it's a 2 way process

Sainthax
07-26-2002, 12:17 PM
all good things must come at a price :(

/usr/local/bin/webalizer: error in loading shared libraries: libgd.so.1.8: cannot open shared object file: No such file or directory

oddly I don't remember deleting those libraries but now their gone

Command history
> locate libgd.so.1.8

blacknight
07-26-2002, 12:51 PM
Strange! I didn't have that problem.
Solution: reinstall the library - you shouldn' have to go near the PHP config ... or should u?

Sainthax
07-26-2002, 01:02 PM
well the current GD version installed is now 2.0 but webalizer is looking for 1.8 so I doubt it's PHP related I'm gonna remove 2.0 and put 1.8 back in and see if that works out.

The 4.2.2 php instructions called for GD 2.0 but I didn't compile with GD so just switching back to 1.8 should fix this

blacknight
07-26-2002, 01:07 PM
I hope so!

Sainthax
07-26-2002, 04:52 PM
gotta love RaQ's you fix one problem and create another one

running the make command on php 4.2.2 still has this error


make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/home/tmp/php-4.2.2/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tmp/php-4.2.2/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tmp/php-4.2.2/ext'
make: *** [all-recursive] Error 1
[root php-4.2.2]#

Sainthax
07-26-2002, 05:08 PM
whats wrong with this picture :confused:

http://download.ngdsinc.com/umm.jpg

blacknight
07-26-2002, 09:07 PM
Ouch!
I know the feeling