International PHP Conference 2015

需要些什么?

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

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

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

add a note add a note

User Contributed Notes 11 notes

up
29
wojciech dot fornal at gmail dot com
7 months ago
For really simple ad hoc server working at any location you want, you can use PHP's built-in web server (available since PHP 5.4.0). Just run in the shell/cli in a directory where you have your .php files:

$ php -S localhost:8000

This will run PHP built-in server on your localhost and port 8000. If you want to learn more about available options you can use --help flag.

$ php --help

Please note that enabling directory listing requires additional effort.
up
18
chris_evans at tesco dot net
11 months ago
On Windows I found WampServer an extremely easy install for Apache, PHP and MySQL and thought it may deserve a mention on this topic.  Available at http://www.wampserver.com/en/.
up
0
gaodacheng22 at gmail dot com
5 months ago
One word on this page -- "在任何操作系统下建立有 PHP 支持的 web 服务器都十分简单,包括 MacOSX、Linux 和 Windiws",  "windiws" maybe spelled "windows".
up
0
BIGBEN
5 months ago
Use LAMP in Linux and install it with tasksel easy to go
up
-14
spiderg at email dot com
11 months ago
If you want to use PHP on Windows, you can use the oficial PHP implementation of Windows, through Microsoft Web Platform. Is free and is integrated with IIS. Check the url http://php.iis.net/
up
-24
rahularora dot net at gmail dot com
11 months ago
Get PHP up and running with WAMP on Windows, MAMP on Mac, LAMP on Linux.
up
-23
me at hemantmaurya dot com
9 months ago
------------------------ MAC OSX ------------------------
Users are always confused that Should they Use MAMP Or XAMP may be sometimes WAMP.

MAMP Got very few updates but xamp Got timely Updated.
up
-91
bloggernitscomp54engg[at]gmail(dot)com
1 year ago
mostly wamp install in window. easy to configure and very easy to use.
up
-96
peaceinoffice at gmail dot com
1 year ago
I use OpenServer is easy to configure and have same extra tools
up
-130
josejayesh at gmail dot com
1 year ago
Use vagrant (http://www.vagrantup.com/ ) , https://www.virtualbox.org/ and https://puphpet.com/ to setup the environment
up
-149
ddiipp at outlook dot com
1 year ago
Use Xampp or Wamp in windows,linux. And MAMP in Mac
To Top