PHP Quick Tip


Some links have been stripped from this article due to age and inaccessibility.

If like me you need to have RPM/.deb based PHP instead of a self compiled option (For example you are using something such as Plesk which wants RPM/.deb based PHP) and you don’t want to play the rpm -Uvh --justdb (or dpkg equivalent) game I discovered today that you can compile just various modules of PHP using a combination of the phpize (found in the php-devel RPM or php5-dev deb package)

Quite why this hasn’t occured to me before but it hadn’t. All you need do is check out the applicable php version source, and then do the following: (Please note $ = normal user # = root)

  $ cd {php-version}/ext/{chosen extension}
  $ phpize
  $ ./configure
  $ make
  $ sudo make install

An alternative is to su - to root and then # cd /path/to/php/ext/module ; make install

then just add the extension={extension}.so in either php.ini or (as on CentOS/RHEL 5) in a {extension}.ini file in the /etc/php.d directory.

Thoughts, as always, appreciated.

comments powered by Disqus