Bluehost.com Web Hosting $6.95

php in terminal shell

This is a discussion on php in terminal shell within the PHP Language forums, part of the PHP Programming Forums category; Hey so I'm not new to php, but I'm no guru either, however recently (6 months) i have ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-16-2008
misterparker@gmail.com
 
Posts: n/a
Default php in terminal shell

Hey so I'm not new to php, but I'm no guru either, however recently (6
months) i have gotten a macbook, and have been playing around on the
terminal, come to find if you type "php" in the terminal, i'm pretty
sure its running php, because i can then type code, however, it
doesn't interpret the code until i press CTRL+D (which quits php) does
anyone know what keystroke or how to just interpret the typed code
without logging out for some quick php testing?
Reply With Quote
  #2 (permalink)  
Old 07-16-2008
Jerry Stuckle
 
Posts: n/a
Default Re: php in terminal shell

misterparker@gmail.com wrote:
> Hey so I'm not new to php, but I'm no guru either, however recently (6
> months) i have gotten a macbook, and have been playing around on the
> terminal, come to find if you type "php" in the terminal, i'm pretty
> sure its running php, because i can then type code, however, it
> doesn't interpret the code until i press CTRL+D (which quits php) does
> anyone know what keystroke or how to just interpret the typed code
> without logging out for some quick php testing?
>


php -h shows you the command line options. -a executes interactively.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Reply With Quote
  #3 (permalink)  
Old 07-17-2008
Toby A Inkster
 
Posts: n/a
Default Re: php in terminal shell

misterparker wrote:

> Hey so I'm not new to php, but I'm no guru either, however recently (6
> months) i have gotten a macbook, and have been playing around on the
> terminal, come to find if you type "php" in the terminal, i'm pretty
> sure its running php, because i can then type code, however, it doesn't
> interpret the code until i press CTRL+D (which quits php) does anyone
> know what keystroke or how to just interpret the typed code without
> logging out for some quick php testing?


The more usual way would be to create a file called "test.php" on your
desktop (or wherever) with all your PHP commands in it, using a text
editor such as TextWrangler <http://barebones.com/>.

Then open your terminal and run "php ~/Desktop/test.php" and you'll see
the output. Keep TextWrangler and the terminal both open at once, and
switch between them, playing around until you get what you want.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.24.4-1mnbcustom-g5n1, up 25 days, 20:23.]
[Now Playing: Ed Harcourt - People are getting younger]

Extending hCard with RDFa
http://tobyinkster.co.uk/blog/2008/07/16/hcard-rdfa/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0