1

I have two php.ini :

  • one regular in /usr/local/php5/lib/php.ini
  • one for my CLI /usr/lib/php.ini

The regular one works fine and load all the extensions I need, whereas the CLI one refuse to load some extensions (such as pdo.so) :

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/pdo.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/pdo.so, 9): image not found in Unknown on line 0

I'd like to change the Configuration File (php.ini) Path of my CLI to make it point on the regular one (and then solve the extension loading problem) but I can't find how to make it on an UNIX system.

1 Answer 1

0

Make the second one a symbolic link to the first. This is done using:

ln -s [TARGET_FILE] [SYMLINK_NAME]

If your non-CLI php.ini is /etc/php.cgi.ini and your CLI php.ini is /etc/php.cli.ini, you'd be doing ln -s /etc/php.cgi.ini /etc/php.cli.ini

Sign up to request clarification or add additional context in comments.

5 Comments

The CLI php.ini links on the regular one but still can't load the extensions : > PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/pdo.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/pdo.so, 9): image not found in Unknown on line 0
Can you check where the actual PHP extension dir is pointing to on both CGI and CLI?
CGI is pointing /usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525, CLI is pointing /usr/lib/php/extensions/no-debug-non-zts-20100525/
Then your problem is that you are using two completely different builds of PHP. Build both in the same fashion - or specify the extension dir explicitely in php.ini.
Do you think it's possible to specify another version of PHP to the CLI ? Is there a configuration file where I can specify it such httpd.conf for Apache in CGI ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.