Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I try to run a script from the command line, a script made by zend framework. I used also the Zend Server who has her own php.ini. When I try to start my script on the command line I am not able to connect with my mysql database. It's because from the command line it takes (it has to be) another php.ini file located somewhere on my Mac OS X Lion system because the path to the mysql.sock isnt the path who is configurated in the zend server php.ini.

I would like to let the command line use my php.ini of zend Server.

I hope someone knows how to do this.

Kind regards, Nicky

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can launch php from the command line with an option to specific the path where the php.ini file you want it to use is located:

php -c /path/to/zend/phpini/folder myfile.php

To find out the the folder where the command line php.ini is located, you can use:

php -i | grep php.ini
share|improve this answer
Thank you that works! But I get a lot of Warnings, like "Failed loading /usr/local/zend/lib/ dlopen(/usr/local/zend/lib/, 9): no suitable image found. Did find: /usr/local/zend/lib/ mach-o, but wrong architecture PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/' - dlopen(/usr/local/zend/lib/php_extensions/, 9): no suitable image found. Did find: /usr/local/zend/lib/php_extensions/ mach-o, but wrong architecture in Unknown on line 0" Normal? – user968898 Dec 6 '11 at 10:44

Your Answer


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.