PHP CLI has me shebanging my head against the wall
I am using Zend Server CE on one of my servers and I’d like to do some PHP work from the CLI. Zend comes bundled with the PHP executable and an associated wrapper for the CLI, cleverly called php-cli. Among other things, this wrapper points to the correct php.ini file, which is key as it contains the information necessary to get PDO (DB abstraction) up and running.
The wrapper essentially contains this code: Code:
#!/bin/sh Code:
#!/opt/zend/bin/php-cli Code:
./cli-test.php: line 2: ?php: No such file or directory Code:
#!/opt/zend/bin/php –c /opt/zend/etc/php.ini Code:
php –c /opt/zend/etc/php.ini |
So if you do 'which php' do you get something sane back? e.g;
Quote:
Quote:
|
Thanks for your reply. The PHP executable and the wrapper (php-cli) are both located in /opt/zend/bin, which is the same path returned by "which php".
|
As anticipated, I'm a fool. The problem was that PHP was looking for php.ini in /usr/local/zend/etc, which doesn't exist. I added a symbolic link to redirect it to the correct place and viola -- success! Of course, I still don't know why it wasn't looking where I told it to with the -c flag, but I'm content in my victory however small.
|
All times are GMT -5. The time now is 03:42 AM. |