LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2012, 11:33 PM   #1
swarup.prem
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Run php from command line?


recently i have installed ubuntu 11.10. i have installed apache.mysql and php. How to start php commands at terminal. If explained in details

thanks
 
Old 01-30-2012, 11:45 PM   #2
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 175

Rep: Reputation: 9
removed

Last edited by ac_kumar; 02-03-2012 at 04:12 AM. Reason: wrong
 
Old 01-31-2012, 12:49 AM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Also, please use descriptive thread titles that say something about your question/problem. You're told to avoid titles like "help me" when you post a thread here.
 
Old 01-31-2012, 05:59 AM   #4
mistofeles
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Rep: Reputation: 1
Quote:
Originally Posted by swarup.prem View Post
recently i have installed ubuntu 11.10. i have installed apache.mysql and php. How to start php commands at terminal. If explained in details

thanks

Try this:
php -r 'echo "\nHELLO, now I should use command ´man php´\n"; echo"It is a good source of information\n\n"'

Last edited by mistofeles; 02-01-2012 at 01:41 AM.
 
1 members found this post helpful.
Old 01-31-2012, 01:49 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,961

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by ac_kumar View Post
i don't know php well but i have run a php script in ubuntu while i test LAMP server (Linux Apache MySql PHP)
the php script is need to be placed in Apache directory (/var/www ) place the php script in index.html than go to browser and type \\localhost to check the script.
Sorry, but this is misleading, and doesn't address the OP's question, which is how to run PHP commands/scripts from the TERMINAL.

OP, mistofeles gave you a good start. Just type in "php <name of your php script/command>", or "php --help" for a list of command-line options.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 12:21 PM
Is command line invocation of gnome-terminal to run more than one command possible? narnie Programming 4 02-17-2010 11:39 PM
How to enter graphical mode (run level 5) command line (run lenel 3) edmondgyampoh Linux - Newbie 3 05-15-2009 07:33 PM
trying to fix xwindows or just run command line... changing run levels dave247 Debian 2 11-18-2008 07:11 PM
run php script from command line blizunt7 Programming 11 11-06-2008 12:59 PM


All times are GMT -5. The time now is 06:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration