PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
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.
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.
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...
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.
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)
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.
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?