hi all
im trying to find out where the hack php5 is installed on my computer..
its not on /usr/bin/php5
im trying to run a php script with the ./ command.
i searched php5 on my computer and enter this code at the begining:

#!/etc/php5/apache2

etc...
allways get the same thing:
"bad interperter: Permssion denied"
anyhelp?

Recommended Answers

All 14 Replies

This will find the php interpreter for you and use it, don't directly link to it.

#!/usr/bin/env php

hi
thanks for your help!
is it

#!/usr/bin/env php

or

#!/usr/bin/env

because the first one doesnt work...

hi
thanks for your help!
is it

#!/usr/bin/env php

or

#!/usr/bin/env

because the first one doesnt work...

It's #!/usr/bin/env php and if that doesn't work then you didn't install php correctly. If you're using ubuntu or any debian distro it is just sudo apt-get install php5 .

i am using ubuntu
and i've installed it like u said...
and still
nothing...
any idea?

i am using ubuntu
and i've installed it like u said...
and still
nothing...
any idea?

type ls /usr/local/bin and if php isn't in that list then reinstall it.

i have nothing on /usr/local/bin
i did sudo apt-get autoremove php5
then sudo apt-get install php5
still nothing...

i have nothing on /usr/local/bin
i did sudo apt-get autoremove php5
then sudo apt-get install php5
still nothing...

type php -v on the command line and paste the output here.

oh, hahaha, did you also do sudo apt-get install php5-cli ?

this is when i typed php5 -v
"the program php5 is currently not installed. you can install it by typinh: apt-get install php5-cli"
the same appeaed when i type php -v.
BTW: im using sun virtual machine.
does it have any affect on it??

yap :)
i tried what he told me to do... :)

ok
i've installed php5-cli
now what?

ok
i've installed php5-cli
now what?

Now do the same thing, type php -v and paste the output here. If it says something like

PHP 5.2.6 (cli) (built: sometime)
Copyright (c) 1997-2009 The PHP Group
Zend Engine blah blah

Then you have it installed correctly and try what I said in my first post to get your script working on the command line

now its working!
thanks alot!

You need to install the command line utilities for PHP: sudo apt-get install php5-cli

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.