Hardware Reference
In-Depth Information
Figure 1-4
The nano text editor.
Once you've created a file, you can delete it using the rm
command, like this:
To get started with PHP, you'll need to make a remote
connection to your web hosting account using ssh as you
did in the last section. Some of the more basic web hosts
don't allow ssh connections, so check to see whether
yours does (and if not, look around for an inexpensive
hosting company that does; it will be well worth it for the
flexibility of working from the command line). Once you're
connected, type:
rm filename
Like rmdir , rm won't ask whether you're sure before it
deletes your file, so use it carefully.
There are many other commands available in the Unix
command shell, but these will suffice to get you started.
For more information, type help at the command prompt
to get a list of commonly used commands. For any
command, you can get its user manual by typing man
commandname . When you're ready to close the con-
nection to your server, type: logout . For more on getting
around Unix and Linux systems using the command line,
see Learning the unix Operating System by Jerry Peek,
Grace Todino-Gonguet, and John Strang (O'Reilly).
php -v
You should get a reply like this:
PHP 5.3.4 (cli) (built: Dec 15 2010 12:15:07)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend
Technologies
This tells what version of PHP is installed on your server.
The code in this topic was written using PHP5, so as long
as you're running that version or later, you'll be fine. PHP
makes it easy to write web pages that can display results
from databases, send messages to other servers, send
email, and more.
PHP
The server programs in this topic are mostly in PHP. PHP
is one of the most common scripting languages for appli-
cations that run on the web server (server-side scripts).
Server-side scripts are programs that allow you to do
more with a web server than just serve fixed pages of text
or HTML. They allow you to access databases through a
browser, save data from a web session to a text file, send
mail from a browser, and more. You'll need a web hosting
account with an Internet service provider for most of the
projects in this topic, and it's likely that your host already
provides access to PHP.
Most of the time, you won't be executing your PHP scripts
directly from the command line. Instead, you'll be calling
the web server application on your server—most likely a
program called Apache—and asking it for a file (this is all
accomplished simply by opening a web browser, typing
in the address of a document on your web server, and
pressing Enter—just like visiting any other web page). If
 
Search WWH ::




Custom Search