5

When I installed pdo-pgsql, the extension was installed into /usr/lib/php/extensions/no-debug-non-zts-20090626/ and thus not automatically loaded. In php.ini, I have extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626" already defined.

Snippet of php.ini

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
extension = "eaccelerator.so"
extension = "pdo.so"
extension = "pdo_pgsql.so"
extension = "pdo_sqlite.so"
extension = "sqlite.so"
extension = "pdo_mysql.so"

Modified to work

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626"
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
zend_extension = "/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"
extension = "eaccelerator.so"
extension = "pdo.so"
extension = "pdo_pgsql.so"
extension = "pdo_sqlite.so"
extension = "sqlite.so"
extension = "pdo_mysql.so"
  1. Why did PECL install pdo-pgsql into the 2nd extension directory and not the first?

  2. Is it recommended to have 2 extension_dir as shown in the 2nd code snippet above?

Nyxynyx
  • 1,459
  • 11
  • 39
  • 49

1 Answers1

8
  1. Because it is the default location when installing via pecl install, while if you compile PHP from source, the extension path should be /usr/local/lib/php/extensions/no-debug-non-zts-20090626.

  2. As far as I know, PHP doesn't support multiple extension_dir, it only pick the last one. Just type php -i | grep eaccelerator to see what happens.

The workaround is copy the extensions to the right path.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • 3
    or make symlinks... – Juris Malinens Sep 13 '12 at 06:43
  • Is this how I should make the symlinks? : `ln -s /usr/lib/php/extensions/no-debug-non-zts-20090626 /usr/php/extensions/no-debug-non-zts-20090626` – Nyxynyx Sep 13 '12 at 11:08
  • It should be: `ln -s /usr/local/lib/php/extensions/no-debug-non-zts-20090626 /usr/lib/php/extensions/no-debug-non-zts-20090626`. But rename it first: `mv /usr/lib/php/extensions/no-debug-non-zts-20090626 /usr/lib/php/extensions/no-debug-non-zts-20090626.bak`. – quanta Sep 13 '12 at 11:12
  • Why would you renname it first? – Nyxynyx Sep 13 '12 at 11:32
  • what happens if you link to a existing directory? – quanta Sep 13 '12 at 13:16