Newbie confusion regarding PHP binary!

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!

Moderator: General Moderators

Post Reply
alexei
Forum Newbie
Posts: 9
Joined: Wed Jul 09, 2003 5:44 pm
Location: Los Angeles, CA, USA

Newbie confusion regarding PHP binary!

Post 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!

:( :(
User avatar
Unifex
Forum Newbie
Posts: 14
Joined: Mon Jul 07, 2003 12:29 am

Post by Unifex »

This sounds like they're asking for the php-cli.

http://www.php.net/features.commandline
alexei
Forum Newbie
Posts: 9
Joined: Wed Jul 09, 2003 5:44 pm
Location: Los Angeles, CA, USA

Post 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.

:cry:
User avatar
Unifex
Forum Newbie
Posts: 14
Joined: Mon Jul 07, 2003 12:29 am

Post by Unifex »

The error your getting means you don't have the php-cli installed. This is a seperate program from the apache module.
User avatar
mrvanjohnson
Forum Contributor
Posts: 137
Joined: Wed May 28, 2003 11:38 am
Location: San Diego, CA

Post 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.
User avatar
Unifex
Forum Newbie
Posts: 14
Joined: Mon Jul 07, 2003 12:29 am

Post 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... :)
alexei
Forum Newbie
Posts: 9
Joined: Wed Jul 09, 2003 5:44 pm
Location: Los Angeles, CA, USA

PHP - binary, ccli, etc

Post 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,
User avatar
Unifex
Forum Newbie
Posts: 14
Joined: Mon Jul 07, 2003 12:29 am

Re: PHP - binary, ccli, etc

Post 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?
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post 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"..
User avatar
Unifex
Forum Newbie
Posts: 14
Joined: Mon Jul 07, 2003 12:29 am

Post 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?
Post Reply