23. PHP5 Extensions for MediaLibrary 3.5.x Shop

In this article is a short explanation of the PHP5 extensions that MediaLibrary needs to use, including links to more information for each extension and instructions about how to install on FreeBSD and Linux.

Please make sure you have:

  • PHP5 extensions installed in PHP5.
  • The library dependencies on the OS which these extensions need, otherwise some MediaLibrary functions will not work!

MediaLibrary needs PHP5 with:

  • cURL (remote files Amazon) - needs libcurl.
  • GD (for CAPTCHA generation - Shop only) - needs GD library with Freetype2

Below are some short explanations of these PHP extensions and links to PHP.net pages with more details.

cURL

Link: http://us.php.net/manual/nl/ref.curl.php
Needs: libcurl version 7.10.5 or greater.
Installation in PHP5: --with-curl[=DIR]

Where DIR is the location of the directory containing the lib and include directories. There should be a folder named "curl" in the "include" directory. It should contain the easy.h and curl.h files.
There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use cURL for URL streams --with-curlwrappers.

GD (only needed for MediaLibrary Shop CAPTCHA)

Link: http://nl2.php.net/gd
Needs: GD library
Installation in PHP5: --with-gd

To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD base install directory. To use the recommended bundled GD library version (which was first bundled in PHP 4.3.0), you can use the configure option --with-gd.
GD library requires libpng and libjpeg to compile! To enable support for FreeType 2 add --with-freetype-dir=DIR.

FreeBSD users:

First make sure that the libraries needed by the PHP extensions are on your system. For FreeBSD users this is easy, because the built-in port dependencies will make sure the proper libraries are installed when you recompile PHP5 with the chosen options.
Anyway, the following will be added to your system:

  • GNOME xml.

For MediaLibrary Shop users also:

  • GD library with Freetype2.
  • Recompiling PHP5.

For FreeBSD all PHP5 extensions can be found in the port /usr/ports/lang/php5-extensionsБ.. Go to that directory and running "make config" you can choose the extensions you want included in your PHP5 installation.
After that run "make all deinstall reinstall clean". Once PHP5 is recompiled, you're done.

Linux users:

First make sure that the libraries needed by the PHP extensions are on your system. Some Linux flavours like Debian and Ubuntu also have a port dependencies system which will take care of this for you.

  • libcurl.

For MediaLibrary Shop users also:

  • GD library with Freetype2.
  • Recompiling PHP5.

Linux users will need to recompile PHP5 with the options needed by explicitly enabling the modules with the configure option, specifying on the command line the following:
MediaLibrary Free users: --with-curl[=DIR]
MediaLibrary Shop users: --with-curl[=DIR] --with-gd[=DIR] --with-freetype-dir=DIR
Once PHP5 is recompiled, you're done.

REMARK:
Your system will stay up and running during the PHP recompiling. After the installation you need only to restart Apache (apachectl restart from the command line), which will give only a 0.5 second interruption of service. Users who are online during the Apache restart will not even notice any disruption.



What are you looking for?
Anti-spam question: How many eyes has a typical person?