PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

第一个 PHP 页面> <入门指引
Last updated: Sun, 25 Nov 2007

view this page in

简明教程

Table of Contents

本章将给出关于 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 服务器)。若在自己安装 PHP 时出现了问题,建议在» 安装邮件列表中询问。如果想使用更简便的方法安装 PHP,那么可以考虑» 获取一个预先配置的安装包,用这个安装包,只用点击几下鼠标,就可以自动地安装所有这些系统。在任何操作系统下建立有 PHP 支持的 web 服务器都十分简单,包括 MacOSX、Linux 和 Windiws。在 Linux 下,会发现 » rpmfind» PBone 能够在获取 RPM 时提供帮助。也可以使用 » apt-get 搜索 Debian 的相关软件包。



第一个 PHP 页面> <入门指引
Last updated: Sun, 25 Nov 2007
 
add a note add a note User Contributed Notes
简明教程
tinko at shock dot com dot pk
25-Oct-2008 03:35
Agreed. Some of the pre-configured packs and associated tutorials really can simplify the installation and get you up and running in minutes but you MUST make sure that as an absolute minimum you add a secure password - ideally a mix of letters, numbers, not a real word etc. Otherwise, when your site/system is live, it will be potentially open to abuse.

http://www.shock.com.pk
dnrlvs at gmail dot com
06-Oct-2008 03:42
I'm new to PHP and recently setup my local machine with PHP and MySQL for doing development.  I was sort of stuck when I needed to post my work for the user to test and review.  After looking around a bit I found a site that hosts PHP and MySQL apps.  I was surprised that it was free - it seems they're offering the service at no cost until 2012.  At that point they'll change over to a fee-based service.  However, in the meantime, it's a great place to do anything from demo and sandbox right up to posting sites for real.

Their pitch is as follows:

"This is absolutely free, there is no catch. You get 350 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages."

Check it out using this link:

http://www.000webhost.com/83188.html

Thanks and good luck!
chris dot fernald at gmail dot com
05-Oct-2008 01:19
I'm new to PHP and recently setup my local machine with PHP and MySQL for doing development.  I was sort of stuck when I needed to post my work for the user to test and review.  After looking around a bit I found a site that hosts PHP and MySQL apps.  I was surprised that it was free - it seems they're offering the service at no cost until 2012.  At that point they'll change over to a fee-based service.  However, in the meantime, it's a great place to do anything from demo and sandbox right up to posting sites for real.

Their pitch is as follows:

"This is absolutely free, there is no catch. You get 350 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages."

Check it out using this link:

http://www.000webhost.com/83188.html

Thanks and good luck!
ctestroote at bresnan dot net
09-Sep-2008 04:21
If youre just learning PHP, then the simpliest thing to use is called Xampp, just install the Apache server and save your php files in the htdocs folder. Then when you open your browser you would type http://127.0.0.1/htdocs/example.php to see your php.

I also use Notepad++ to write my php files but there are many others to use.
Michael
01-Mar-2007 01:54
Agreed. Some of the pre-configured packs and associated tutorials really can simplify the installation and get you up and running in minutes but you MUST make sure that as an absolute minimum you add a secure password - ideally a mix of letters, numbers, not a real word etc. Otherwise, when your site/system is live, it will be potentially open to abuse.
cvncpu
25-Oct-2006 11:53
just keep in mind that these installation packages are for development use, and are not built for a production enviroment, the preformance and security of these tools is not setup for use in a public website.

第一个 PHP 页面> <入门指引
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites