davidthorne.net

The personal website of David Thorne

Navigation

  • Home Page
  • CV
  • Security Keys
  • Open Source
  • My Blog
  • My Twitter
  • Contact David Thorne
  • Recent posts
Home | Blogs | dthorne's blog

PHP quick tip

Wed, 09/01/2010 - 13:08 |  dthorne

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 or php5-dev rpm/deb)

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.

dthorne's blog  |  Tags: Development, PHP, Quick Tip, Tutorial
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.

© Copyright 2009 David Thorne.  Hosted by Contemporary Fusion Computer Services Limited