2

I would like to install php53 on CentOS 5.10 64-bit without the httpd dependency. The reason being the production server has a custom compiled binary of a newer version of httpd.

Is installing php53 on CentOS5 without the httpd dependency even possible?

superbarney
  • 73
  • 1
  • 7

2 Answers2

2

With the edit it's more clear what you want.
You already have httpd installed but not via RPMs.

In that case you can do it the way you did it by extracting the RPM.
Or by downloading the rpm and installing it via rpm -i --nodeps php53.....
In any case this won't be very nice.

If you install the RPM then upgrading the box won't be nice and might break it.
If you manually extract the shared object and place it there, you won't notice if there is an update with the standard CentOS tools.

faker
  • 17,496
  • 2
  • 60
  • 70
  • I need to run php cgi/serve php web pages so I guess php-cli alone won't be enough. – superbarney Jun 09 '14 at 02:17
  • It's really hard to say if we don't know what you are really trying to do. Maybe `php-fpm` is what you are looking for. – faker Jun 09 '14 at 09:21
  • PHP 5.3 is available for CentOS/RHEL 5.10 without the need to use a 3rd party repo. As this is a production server, I'd like to limit the use of 3rd party repositories as much and as long as I can. – superbarney Jun 11 '14 at 15:22
  • Yes, I also just noticed this (since CentOS 5.6 it seems). Anyway, with a self compiled Apache you may always need to manually copy files around. Alternative to your way would be to install the php53 package with `--nodeps` option. *Maybe*... – faker Jun 11 '14 at 15:28
1

Here's the workaround that I did:

Install yum-utils and find out what files are in the package php53

# yum install yum-utils
# repoquery --list php53
/etc/httpd/conf.d/php.conf
/usr/lib/httpd/modules/libphp5.so
/var/lib/php/session
/var/www/icons/php.gif

Install the yum-downloadonly plugin for yum

# yum install yum-downloadonly

Download the php53 RPM package without installing

# yum install --downloadonly --downloaddir=/home/dump php53

Unpack the RPM package

# rpm2cpio php53-5.3.3-22.el5_10.x86_64.rpm | cpio -idmv

Copy the files from the RPM package to its relevant place on the server

# cp php.conf /etc/httpd/conf.d/php.conf
# cp libphp5.so /usr/lib/httpd/modules/libphp5.so
... etc

No httpd installed!

superbarney
  • 73
  • 1
  • 7