Running PHP from Debian command line

I have installed the base version of Debian, Apache and PHP5.
Apache can run php scripts  but I can't for the life of me find the php executable in the file system so that I can run php from the command line.

When I run apt-get install php5 I am told its already installed.

Where is the php executable hiding or how can I find out?

find / -name "php*" -print| while read file; do file $file; done
/var/lib/php5: sticky directory
/var/lib/dpkg/info/php5.list: ASCII text
/var/lib/dpkg/info/php5-common.conffiles: ASCII text
/var/lib/dpkg/info/php5-common.postrm: Bourne-Again shell script text executable
/var/lib/dpkg/info/php5-common.list: ASCII text
/var/lib/dpkg/info/php5-common.md5sums: ASCII text
/var/www/phpinfo.php: PHP script text
/var/cache/apt/archives/php5-common_5.2.6.dfsg.1-1+lenny3_i386.deb: Debian binary package (format 2.0)
/var/cache/apt/archives/php5_5.2.6.dfsg.1-1+lenny3_all.deb: Debian binary package (format 2.0)
/usr/lib/php5: directory
/usr/share/php5: directory
/usr/share/php5/php.ini-dist: ASCII English text
/usr/share/php5/php.ini-dist.cli: ASCII English text
/usr/share/doc/php5: symbolic link to `php5-common'
/usr/share/doc/php5-common: directory
/usr/share/doc/php5-common/examples/php.ini-dist: ASCII English text
/usr/share/doc/php5-common/examples/php.ini-recommended: ASCII English text
/usr/share/doc/php5-common/examples/php.ini-paranoid: ASCII English text, with very long lines
/usr/share/lintian/overrides/php5-common: ASCII text
/etc/php5: directory
/etc/php5/apache2/php.ini: ASCII English text
/etc/apache2/mods-enabled/php5.conf: symbolic link to `../mods-available/php5.conf'
/etc/apache2/mods-enabled/php5.load: symbolic link to `../mods-available/php5.load'
/etc/apache2/mods-available/php5.conf: ASCII text
/etc/apache2/mods-available/php5.load: ASCII text
/etc/cron.d/php5: ASCII English text

but to no avail.

Help please
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


whereis php

which php

it will show the path for executable
brothertomAuthor Commented:
thats the point I guess, its not on the path and the executable does not seem to be on the filesystem, however Apache is obviously running something
whereis php

did it return anything??

also which php

C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

brothertomAuthor Commented:

debian:~# whereis php
debian:~# which php
brothertomAuthor Commented:
Normally its in /usr/bin but not on this box
I'm new to Debian, so I may be missing something obvious.
type "find / -name php" in a terminal, it should return the location of the php executable, if not, that means you somehow got php_cgi but not php cli.

if that's the case, type "apt-get install php" to install the cli
brothertomAuthor Commented:
but if I run the following via the Apache webserver, php is obivously installed - see attached pdf - any help?



brothertomAuthor Commented:
the php_cgi seems plausable, but when I run apt-get, I get the following - can I force a re-install of php5 without screwing up apache?

debian:~# apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package php
debian:~# apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
if you do a backup of your configuration files, I don't see it failing, I can't test it here but I'm pretty sure you can force a re-install of the php5 package without breaking apache.

I wouldn't try on a production server before confirming.
Don't reinstall everything.... that's not the problem.  install the php5-cli package.  It's not installed by default with the php5 package.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brothertomAuthor Commented:
That did the job, thanks psycle.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.