Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running PHP script from command line

Status
Not open for further replies.

RicoCali

Programmer
Joined
Dec 7, 2002
Messages
80
Location
US
I've grown acustom to PHP for web development. But now I want to do some processing from Linux command line using php scripts. I really dont want to learn Korn Shell to do this. My brain is already overloaded with knowing too many programming languages and scripting languages. I can't keep them straight anymore. So how do I tell Linux that I want to run php scripts in its evironment?
 
I may be wrong, but I dont' believe PHP can be ran via command line.. 'PERL' is better suited for this task
 
Have you tried
Code:
php <path to your script>
? On my system, it's at /usr/bin/php (Mandrake 9.1)

----
JBR
 
As of 4.3 (I think) a special version of PHP has been released with the main build which as command line switches hard coded to allow use in command line mode. If you have an earlier version try /path to php/php -q script.php where the -q means quiet and wont issue http headers. A library (pjp-gtk ??0 exists which allow GUI apps to be written as well.


Lonmg live PHP !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top