Page 1 of 1

PHP5 on unbuntu

Posted: Mon Sep 18, 2006 8:14 pm
by akimm
I am wondering if anyone can help me get my CLI running, or how exactly I would do that, via bash, or otherwise?

Posted: Mon Sep 18, 2006 8:17 pm
by feyd

Code: Select all

> sudo apt-get install php5
I think it what I ran the first time. Although I've done the builds myself more recently.

Posted: Mon Sep 18, 2006 8:33 pm
by akimm
No Feyd, I know I mislabled the post. I just did that to attract someone like you to an easy answer.

Which my answer will still invariably be easy, but not so much so.


i have php5 in my etc

I just want to know how to use the Command line aspect of PHP, so I can write scripts in the terminal, which i know i still could with cat > php.php or whatever I might choose to name it, but I thought that PHP could be compilled on the spot in the terminal. Am I correct on this?

Posted: Tue Sep 19, 2006 5:00 am
by Jenk
Have you enabled CLI as per instructions on php.net?

Is /etc/php5 in your PATH? (adjust /etc/php5 as necessary)

have you run:

Code: Select all

sudo chmod +x /etc/php5/php
(change php to name of php executable)

have you checked all the php.ini directives?

if yes to all the above, then simply:

Code: Select all

#: php -r <your code here>
where #: represents your command prompt (i.e. don't type it..)

Posted: Tue Sep 19, 2006 5:03 am
by volka
the php executable is in /etc ? I find that hard to believe.
Aynway, try php -v in the (bash) command line. What does it print?