473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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?
Jul 16 '08 #1
2 7270
mi**********@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.
js*******@attglobal.net
==================

Jul 16 '08 #2
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/
Jul 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: J Turner | last post by:
Hello, I'm playing with a python-based shell, which uses (guess what?) python as it's scripting language, for iterative invocation, environment variables, etc. Everything was going well,...
2
by: egbert | last post by:
When I start the following script in a gnome-terminal: #!/usr/bin/env python import os print "hello gnome-terminal" print os.environ I see the expected results in the same gnome-terminal...
14
by: mystilleef | last post by:
Hello, A user of my application points me to a behavior in gVim, the text editor, that I would like to implement in my application. When gVim is launched from a shell terminal, it completely...
20
by: Joel Hedlund | last post by:
Hi all! I use python for writing terminal applications and I have been bothered by how hard it seems to be to determine the terminal size. What is the best way of doing this? At the end I've...
16
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of...
16
by: John Salerno | last post by:
Here's my new project: I want to write a little script that I can type at the terminal like this: $ scriptname package1 where scriptname is my module name and any subsequent arguments are the...
0
by: jcor | last post by:
Hi, I'd like to lauch a shell from my perl program. I'm using the code system "gnome-terminal -e,--command='ping 192.168.1.1'"; But i'd like that my terminal stays minimized. Now, it opens...
8
by: james.kirin39 | last post by:
Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an...
4
by: gaurav kashyap | last post by:
Dear all, I am using Microsoft Windows XP.Using putty.exe,I connected to LINUX server and a terminal window gets opened.Here i logeed in as root. What i want to do is open another terminal...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.