简明教程
在线手册:中文 英文
PHP手册

需要些什么?

在本教程中,假设用户的服务器已经安装并运行了 PHP,所有以 .php 结尾的文件都将由 PHP 来处理。在大部分的服务器上,这是 PHP 的默认扩展名,不过,也请询问服务器管理员以确认。如果服务器支持 PHP,则不需要做任何事情。只用建立 .php 文件,并把它们放置到 web 目录中,服务器将神奇地自动解析这些文件。不用编译任何东西,也不用安装任何其它的工具,仅仅只需把这些使用了 PHP 的文件想象成简单的 HTML 文件,其中只不过多了一种新的标识符,在这里可以做各种各样的事情。大多数的 web 主机都提供 PHP 的支持,如果你的主机不支持,可以访问 » PHP 相关链接来查找支持 PHP 的 web 主机。

假设用户希望在本地机器开发以节约宝贵的带宽。在这种情况下,需要安装一个诸如 » Apache 的 web 服务器,当然还有 » PHP。可能还希望安装一个数据库,例如 » MySQL

可以一个个的安装它们或选择一个更简单的方法。可以参考本手册中 PHP 安装说明的相关章节(假设已经配置好了某个 web 服务器)。若在自己安装 PHP 时出现了问题,建议在» 安装邮件列表中询问。如果想使用更简便的方法安装 PHP,那么可以考虑» 获取一个预先配置的安装包,用这个安装包,只用点击几下鼠标,就可以自动地安装所有这些系统。在任何操作系统下建立有 PHP 支持的 web 服务器都十分简单,包括 MacOSX、Linux 和 Windiws。在 Linux 下,会发现 » rpmfind» PBone 能够在获取 RPM 时提供帮助。也可以使用 » apt-get 搜索 Debian 的相关软件包。


简明教程
在线手册:中文 英文
PHP手册
PHP手册 - N: 需要些什么?

用户评论:

snarkit at hotmail dot com (07-Mar-2012 11:06)

PHP5.2.17 for Apache 2.2.
The automatic Windows installer did not configure PHP correctly in httpd.conf. It left off the path to the module and PHPIniDir was blank. Adding the path got my installation working.
Incidentally Windows paths seem to be given in some places with / and in other places with \. It may not matter, but it is probably wise to stick to the pattern used in the relevant example.

Dennis (17-Feb-2011 07:08)

On Ubuntu, you can install everything in a single command.
Just open your terminal window and type:

    sudo apt-get install lamp-server^

(the ^ symbol at the end of this command is mandatory)

jtbowlin at gmail dot com (05-Aug-2010 10:42)

Rather than WAMP or XAMPP, I find it much easier and straightforward to use Windows Web Platform Installer...

chris at yahoo dot com (22-Mar-2010 08:33)

One nice thing about WAMP is it's ability to install multiple versions of PHP, MySQL, and/or Apache and then easily select between them using the wampServer control panel. This allows you to test your app between various versions if you need that ability. XAMPP only supports one version of PHP, MySQL, and Apache.

shears dot wayne at googlemail dot com (09-Mar-2009 01:23)

Rather than WAMP as suggested above you can use XAMMP which is a very useful tool which is easy to install and run.

You can use this on Windows/Linux/Mac based machines (including vista) to locally test your applications. The secuirty on the server is limited at first and if you set up port forwarding to allow users from the 'outside world' to see you applications you will required to address a few security issues.

But all in all this tool is great to use for Windows users who want to test locally and like a simple install.

URL:
http://www.apachefriends.org/en/xampp.html

jason dot khov at gmail dot com (28-Dec-2008 05:49)

Don't worry about installing your own LAMP environment.  (Linux, Apache, MySQL and PHP)

On windows, you can download and install WAMP.  With one installation and you get an apache webserver, database server and php.
http://www.wampserver.com

On mac, you can download and install MAMP.
http://www.mamp.info/

Saves me a lot of headache to do development locally on my computer.