Page 1 of 1
Newbie confusion regarding PHP binary!
Posted: Wed Jul 09, 2003 5:44 pm
by alexei
Please point me in the right direction!
I've successfully installed PHP 4.3.2 package on Mac OS from "entropy" and already have some ready-made scripts and some written by me working properly.
One of the scripts I got has a "Autoresponder" module that askes me to have "php binary" installed in addition to normal Apache module. I searched and searched and got confused to no end. Some sources almost equate php binary with CGI, other say that php binary file is installed by default with PHP 4.3.2 - it looks it is not in my case.
Calling "which php" "or php -v" gives an error. On the other hand, calling phpinfo() function shows that everything is OK.
Any help would be greatly appreciated!

Posted: Wed Jul 09, 2003 8:22 pm
by Unifex
This sounds like they're asking for the php-cli.
http://www.php.net/features.commandline
Posted: Thu Jul 10, 2003 1:08 am
by alexei
Thanks for the tip!
It looks that when PHP is compiled --with apxs CLI is placed somewhere else. This article also suggests to enter php -v in the shell to fing out what is installed, CGI or CLI, but in my case shell just answers "no such command" - like there is no PHP at all, which is not true - scripts are working.
So. I am a real newbie, I got even more confused. Here is a quote from the script manual that got me started:
"You must have the PHP binary installed (in addition to the Apache module). Issue the command "php -v" at a shell to determine whether or not the binary exists on your system."
So I tried "php -v", got error and it is already 3 days that I am looking all over the web for an answer and still am where I was in the beginning.

Posted: Thu Jul 10, 2003 7:21 pm
by Unifex
The error your getting means you don't have the php-cli installed. This is a seperate program from the apache module.
Posted: Thu Jul 10, 2003 7:28 pm
by mrvanjohnson
I believe this can also mean you don't have php in the Path of the user. You might want to try doing an su (I assume there is an su under OS X) and the try php -v. This is only going to give you the version of php you are using. Same info you are getting with phpinfo. But the Path problem might be why you can't call the CLI.
Posted: Thu Jul 10, 2003 7:34 pm
by Unifex
Good point.
Although if the cli version is installed you have to wonder at the ability of the people that packaged it up if they didn't add/symlink it into the path...

PHP - binary, ccli, etc
Posted: Sat Jul 12, 2003 1:31 pm
by alexei
I appreciate all the replies my question caused! I feel really dumb because I still don't understand what I should do.
I still don't know how to find if the CLI version was installed.
I still don't know how to find it if it was installed.
And because of that I don't know how to alter the path - I still don't know WHERE php that is supposed to be accessed by "php -v" is located.
"php -v" gives "command not found". Does that mean that I don't have CLI or just that there is no path?
I guess your comments are very useful, but not to such ignoramus as me.
Thanks,
Re: PHP - binary, ccli, etc
Posted: Sat Jul 12, 2003 9:58 pm
by Unifex
alexei wrote:
(snip)
I still don't know how to find if the CLI version was installed.
(snip)
"php -v" gives "command not found". Does that mean that I don't have CLI or just that there is no path?
(snip)
It's not installed.
http://www.php.net/downloads.php
There's no mention of a CLI version though. Does anyone know if the cgi one is the same thing?
Posted: Sat Jul 12, 2003 10:29 pm
by qartis
Well, not necessarily. If it's installed itself into an obscure location, try to find it with "locate php", cd to that directory, and execute it from there.
That's assuming that Mac OS has "locate"..
Posted: Sat Jul 12, 2003 10:37 pm
by Unifex
Sorry, this was meant to be part of my previous point.
I don't know much about MacOS but unless alexei has compiled it themselves and messed up hte configure stage I doubt that any package would install to an obsure directory.
Alexei, where did you get the current install of php from? Was it already installed or did you download it from some website? If the latter can you point us at it?