This isn't a PHP issue, it's a *n*x issue. To execute a program in the current directory, you must type "./PROGRAM". So, instead of typing "php -v", type "./php -v".
Bingo! That did the trick.
Follow up question, I ran shell> top and don't see anything labeled php in the list of running processes. Is the CLI supposed to run in the background like MySQL?
Ken
Ken Tozier wrote:
I've been trying for about 6 hours to get the PHP CLI working Mac OS 10.2.4 but am not having any luck. Anyone have any suggestions?
//Make the PHP CLI binary
[my-Computer:/apps/php-4.3.2rc1] myusername# make install-cli
<lots of compiler messages here, then...>
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
// Verifying that "php" is actually there...
[my-Computer:/usr/local/bin] myusername% ls /usr/local/bin
Magick++-config convert montage pack_isam php-config resolve_stack_dump
Magick-config identify my_print_defaults pear phpextdist resolveip
comp_err isamchk myisamchk perror phpize
composite mogrify myisampack php replace
// try to get info from the command line
[my-Computer:/usr/local/bin] myusername% php -v
php: Command not found.
// Since the cli lib is clearly where the documentation says it should be and I'm sure I missed something, but multiple readings of "http://www.php.net/manual/en/features.commandline.php" hasn't gotten me any closer to getting this thing working. Are there some out of the way config variables that need setting? Some files that need to be moved manually? Any help appreciated.
Thanks
Ken
P.S. PHP is working great inside my browser, I just can't get the CLI working...
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.