PHP5 on unbuntu

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

PHP5 on unbuntu

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post 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?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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..)
Last edited by Jenk on Tue Sep 19, 2006 5:04 am, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

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