|
|
 |
章 2. 简明教程
本章我们将给出关于 PHP 的简明教程。虽然 PHP 的功能并不局限于生成动态的 WEB 页面,但本章的内容仅涉及于此。请查阅题为“PHP 能做什么?”一节以获取更多信息。
使用了 PHP 的 WEB 页面将被和通常的 HTML 页面一样处理,您可以用建立 HTML 页面的通常方法来建立和编辑它们。
在本教程中,我们假设您的服务器已经安装并运行了 PHP,所有以 .php 结尾的文件都将由 PHP 来处理。在大部分的服务器上,这是 PHP 的默认扩展名,不过,也请询问您的服务器管理员以确认。如果您的服务器支持 PHP,则您不需要做任何事情。您只用建立您的 .php 文件,并把他们放置到您的 WEB 目录中,服务器将神奇的自动为您解析这些文件。您不用编译任何东西,也不用安装任何其它的工具,您仅仅只需把这些使用了 PHP 的文件想象成简单的 HTML 文件,其中只不过多了一种新的标识符,在这里您可以做各种各样的事情。大多数的 WEB 主机都提供 PHP 的支持,如果您的主机不支持,您可以阅读“PHP 链接”一节中的资源来查找支持 PHP 的 WEB 主机。
我们假设您希望在本地机器开发以节约宝贵的带宽。在这种情况下,您需要安装一个诸如 Apache 的 WEB 服务器,当然还有 PHP。您可能还希望安装一个数据库,例如 MySQL。您可以单独安装它们,当然简单的方法是获取一个预先配置的安装包,用这个安装包,您只用点击几下鼠标,就可以自动的安装所有这些系统。在任何操作系统下建立有 PHP 支持的 WEB 服务器都十分简单,包括 Linux 和 Windiws。在 Linux 下,您会发现 rpmfind 和 PBone 能够在获取 RPM 时为您提供帮助。
29-Nov-2003 10:14
Another good place to start is http://www.allsyntax.com and get more
information on PHP and working with MySQL. Also, pay a visit to
www.mysql.com and the newest version is available
gr33dy
28-Nov-2003 10:52
A free and easy web server to install is http://www.aprelium.com. It is easy to
configure using an html control panel, and the support is excellent. I
also recommend using a DNS service, such as http://www.microtech.co.gg/dns
which will give you a URL such as www.mysite.DNSservice.com - much easier
if you have a dynamic I.P. address.
Walrus99
24-Oct-2003 11:08
More for OS X Users,
The book "Mac OS X" by J. Ray and W.
Ray has a good chapter on gettng PHP going on OS X 10.2. PHP is already
installed on OS X 10.2. It just requires some changes in the
configuration file for Apache.
http://www.mysql.com/ has MySQL 4.0
available for download for OS X as a dmg file, which is very easy to
install. http://www.mysql.com/downloads/mysql-4.0.html
I
wouldn't try this if you are a novice, but if you have experience using the
terminal, databases, and a scripting language, this is a quick and easy way
to start learning PHP and MySQL. I was able to get a page on the server
that accessed a database in MySQL in a few hours of work. Be careful of
security measures.
I am not sure if PHP is on 10.3, but I assume it
will be. It is not on versions before 10.2.
fukuman
28-Sep-2003 08:25
Mac OS X users,
a good place to start is with this site: http://www.serverlogistics.com/ then
you can get the Complete PHP , Complete Apache2, and Complete MySQL
packages. please note the default Apache in OS X is 1.3.27 so enabling
Apache2 you don't turn on
SystemPref>>Sharing>>PersonalWebSharing. consult the docs that
come with the downloads. It's pretty easy to do. all install nicely and are
enabled. They install into /Library/Apache2, /Library/MySQL/ and
/Library/PHP4/ the Install Guide.pdf for each package documents the
installs excellently. and the Apache2 and MySQL packages come with a
preference pane to easily control the starting of the msqld and apache2
webserver. So do yourself a favour. use the ServerLogistics packages.
| |