Help - Search - Members - Calendar
Full Version: Re-compile php installed through yum
The Planet Forums > Control Panels > Plesk
DirtyHarry
As many Plesk users are used to do, I used Atomic Rocket Turtle's packages with yum to update php on my server. Now, I need to add new options to php, in particular support for zip files. How can I re-compile php with the installation I have and activating the options I need?
Squire
There should be some (older) tutorials around here somewhere about compiling PHP from the source. They'll still apply to compiling new versions of PHP

Basically you need to download the version of PHP you need from php.net, then type or cut and paste ./configure commands into your SSH command line client, then make and make install.

If any of the modules you want to add into the mix are not already on your server you'll need to install those prior to compiling PHP. You also may need to do a bit of editing of you php.ini file. And of course you'll need to restart apache after you're done compiling php to get everything to take effect.

As a safety procedure I also make a backup copy of the current php.ini, libphp4.so and httpd.conf files prior to compiling PHP. That way if something goes wrong I can put those back into place quickly, restart PHP again and have the older version working in mere seconds.

FTR, if the only need to add one or two things into the mix you may be able to find an RPM version of that for your server type, and install it that way. It really depends upon what you're trying to add into the mix though. You could also grab ATR's PHP RPM source files and build your own RPM that will include the extra things you need.
DirtyHarry
I have tried rebuilding Art's rpm, but I get this error:

CODE
[root@dragon packages]# rpmbuild -ba /usr/src/redhat/SPECS/php-4.3.11-art.spec

cat: /usr/include/httpd/.mmn: No such file or directory

error: Failed build dependencies:

       bzip2-devel is needed by php-4.3.11-3.art

       aspell-devel is needed by php-4.3.11-3.art

       httpd-devel is needed by php-4.3.11-3.art

       libjpeg-devel is needed by php-4.3.11-3.art

       libpng-devel is needed by php-4.3.11-3.art

       pcre-devel is needed by php-4.3.11-3.art

       unixODBC-devel is needed by php-4.3.11-3.art

       net-snmp-devel is needed by php-4.3.11-3.art

       elfutils-devel is needed by php-4.3.11-3.art

       libxslt-devel >= 1.0.18-1 is needed by php-4.3.11-3.art

       freetype-devel is needed by php-4.3.11-3.art


I updated the required dependencies, but I still get the first error.
DirtyHarry
QUOTE (Squire)
There should be some (older) tutorials around here somewhere about compiling PHP from the source.  They'll still apply to compiling new versions of PHP

Basically you need to download the version of PHP you need from php.net, then type or cut and paste ./configure commands into your SSH command line client, then make and make install.

If any of the modules you want to add into the mix are not already on your server you'll need to install those prior to compiling PHP.  You also may need to do a bit of editing of you php.ini file.  And of course you'll need to restart apache after you're done compiling php to get everything to take effect.

As a safety procedure I also make a backup copy of the current php.ini, libphp4.so and httpd.conf files prior to compiling PHP.  That way if something goes wrong I can put those back into place quickly, restart PHP again and have the older version working in mere seconds.

FTR, if the only need to add one or two things into the mix you may be able to find an RPM version of that for your server type, and install it that way.  It really depends upon what you're trying to add into the mix though.  You could also grab ATR's PHP RPM source files and build your own RPM that will include the extra things you need.



Should I choose to install php from source: I have custom setting for websites within vhost.conf files; will those be overwritten if I compile from source?

System is rh9/Plesk6.0.2

Thank you!
newuser
best way to compile php/apache is by using apachetoolbox

just google it.
DirtyHarry
configure: exit 1
+ make
make: *** No targets specified and no makefile found. Stop.
error: Bad exit status from /var/tmp/rpm-tmp.96270 (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.96270 (%build)


I missed one dependency.

This is the error I get now...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.