Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Php Cli

Php Cli
Thread Tools
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Aug 9, 2004, 03:55 AM
 
Hey guys,

I'm not much of a UNIX buff, but I'm wondering, is it possible to send plain text PHP/HTML to the CLI tool, and have it spit out the processed PHP/HTML?

And if so, how?

Thanks,
Oliver
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Aug 9, 2004, 08:23 AM
 
Originally posted by iOliverC:
Hey guys,

I'm not much of a UNIX buff, but I'm wondering, is it possible to send plain text PHP/HTML to the CLI tool, and have it spit out the processed PHP/HTML?

And if so, how?
Sure... it's called a web browser. Something like:

mozilla somefile.php
or
mozilla somefile.html

It will open mozilla (if you have it installed in your path) with the file as input and it will "process" it.
-DU-...etc...
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 9, 2004, 08:24 AM
 
Originally posted by iOliverC:
I'm not much of a UNIX buff, but I'm wondering, is it possible to send plain text PHP/HTML to the CLI tool, and have it spit out the processed PHP/HTML?
Depending on how you installed PHP (I used the entropy.ch package), you can just do:

Code:
/usr/bin/php test.php
If you want to capture the output into a file, do:

Code:
/usr/bin/php test.php > testoutput.html
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Aug 9, 2004, 08:42 AM
 
Originally posted by Arkham_c:
Depending on how you installed PHP (I used the entropy.ch package), you can just do:

Code:
/usr/bin/php test.php
If you want to capture the output into a file, do:

Code:
/usr/bin/php test.php > testoutput.html
Thats what I wanted to hear .

Is the OS X default installation available at /usr/bin/php?

Thanks,
Oliver
     
Senior User
Join Date: Jun 2002
Location: UK
Status: Offline
Reply With Quote
Aug 9, 2004, 09:15 AM
 
Originally posted by iOliverC:
Thats what I wanted to hear .

Is the OS X default installation available at /usr/bin/php?

Thanks,
Oliver
In Mac OS X 10.3, yes
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Aug 9, 2004, 10:46 AM
 
It should be noted that this is exactly what HyperEdit uses to do live PHP rendering.
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:30 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2