Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:Hakre/HowTo PECL on Opensuse

Back to my Page

HOWTO: PECL on Opensuse

Installing PECL on Openuse and installing PECL packages afterwards is now pretty easy for me, because of my HOWTO here. From ground up, I'm a Opensuse newbie because it's not my preferred distro. Therefore I wrote down this for documentation purposes. It's based on Opensuse 11.1 I found on a virtual server located at a hoster named Strato (Germany/Berlin).

If you wonder where PECL is located, it ships with the php5-devel package. In any case, to get it installed so enabling you to install PECL Extension on a vanilla opensuse 11.1, I did the following:

Installing and Setting up PECL

~# yast -i gcc autoconf php5 php5-pear php5-devel

That command just installs needed packages. At least those were the modules I needed with my setup but I think it's pretty complete:

  1. gcc - the compiler, needed to compile sourcecode
  2. autoconf - needed to build modules, that's a step previous to compile
  3. php5 - the php5 package
  4. php5-pear - the php5 pear repository. pear is related to pecl therefore grab it, it does not hurt.
  5. php5-devel - headers, PECL and all the stuff you need to compile extentsions source

Afterwards pecl should be available which can be easily tested:

~# pecl version

Since channels update quite often, run

~# pecl channel-update pecl.php.net

After this, your PECL setup should be done.

Installing a PECL extension

Now it's up to you to install the PECL extensions you would like to have. You do this with the normal PECL install command. Next is an example to install the zip extension:

~# pecl install zip

This might take some time depending on how much power your box has. If it fails, read the output to identify if something is missing or what is going wrong.

Afterwards you have to take care that the extension is loaded. This needs a configuration of the php.ini file(s) by adding the line

extension=zip.so

to it. you can do this by adding a file named zip.ini to the configuration directory /etc/php5/conf.d . The directory for the actual extension is /usr/lib/php5/extensions.

Afterwards you have to make shure that the PHP interpreter is reflecting the changes. For FCGI just locate the process and send a SIGTERM to it. If you like it comfortable consider to use htop for it:

~# yast -i htop
~# htop

This should make it easy for you to determine the right process.

Testing

Afterwards using the phpinfo(); function requested from the webside should provide you the info about loaded extensions as well as loaded ini files.

This worked on a Strato V-PowerServer virtual server I was doing some support on. The server is documented in the compability list of hosters as well.

Notes

  1. A User reported in November 2008 that PECL needs GeoIP (for the popular PECL GeoIP Package), so you might want to install libGeoIP-devel as well.