Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted
  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.

share|improve this answer
    
or make symlinks... –  Juris Malinens Sep 13 '12 at 6: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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.