Can we have 2 'extension_dir' in php.ini?
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
.As far as I know, PHP doesn't support multiple
extension_dir
, it only pick the last one. Just typephp -i | grep eaccelerator
to see what happens.
The workaround is copy the extensions to the right path.
Related videos on Youtube
Nyxynyx
Hello :) These days its web development: PHP, Codeigniter, node.js, Javascript, jQuery, MySQL, mongoDB, HTML/CSS
Updated on September 18, 2022Comments
-
Nyxynyx almost 2 years
When I installed pdo-pgsql, the extension was installed into
/usr/lib/php/extensions/no-debug-non-zts-20090626/
and thus not automatically loaded. Inphp.ini
, I haveextension_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"
Why did PECL install pdo-pgsql into the 2nd extension directory and not the first?
Is it recommended to have 2
extension_dir
as shown in the 2nd code snippet above?
-
Juris Malinens almost 12 yearsor make symlinks...
-
Nyxynyx almost 12 yearsIs 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
-
Greg Petersen almost 12 yearsIt 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
. -
Nyxynyx almost 12 yearsWhy would you renname it first?
-
Greg Petersen almost 12 yearswhat happens if you link to a existing directory?