Home > Backend Development > PHP Tutorial > Eclipse PHP环境筹建

Eclipse PHP环境筹建

WBOY
Release: 2016-06-13 13:21:19
Original
968 people have browsed it

Eclipse PHP环境搭建

参考了PHP和 MySql Web开发一书以及相关网络资源 搭建Eclipse PHP开发环境

准备工作:下载Apache http://httpd.apache.org/?? 后缀为msi

????????????? 下载 PHP安装文件 ? http://windows.php.net/download/?installer

??????????? 下载Eclipse PHP版

?? Apache和PHP进行默认安装,在安装的过程中先安装Apache,后安装PHP 的installer,这样会在Apache中conf目录下的httpd.conf文件以及PHP目录的PHP.ini文件进行自动的配置, 我们不需要做任何修改。

自动修改的内容应该是:

php.ini文件中

?1) extension_dir = "./"??? 修改为 extension_dir = "C:/php-5.2.6/ext"
?2) ;extension=php_mysql.dll”和“;extension=php_gd2.dll”,去掉前面的分号,即把 ;extension=php_mysql.dll 改为 extension=php_mysql.dll
把 ;extension=php_gd2.dll 改为 extension=php_gd2.dll
?3).保存好php.ini,然后重起apache

2. 修改Apache/conf下的httpd.conf,在文件尾部添加:

LoadModule php5_module "C:/php-5.2.6/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Action application/x-httpd-php "/php/php-cgi.exe"
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddDefaultCharset UTF8

PHPIniDir "C:/php-5.2.6"

?

我们需要在.在环境变量的Path设置下添加:

C:\php-5.2.6;C:\php-5.2.6\ext

?

经过上述配置,在Apache/htdocs目录下创建一个php测试文件index.php如下:

php

?phpinfo();
?>

记得重新启动Apache。

打开IE在地址栏输入:http://127.0.0.1/index.php,如果能工作就表示php和apache能工作了。

?

安装调试环境XDebugger:

下载XDebugger文件,是一个Dll,放到PHP的Ext目录下,在PHP.ini文件最后添加如下内容

;onload Xdebug;载入Xdebug

zend_extension_ts="D:/Program Files/PHP/ext/php_xdebug-2.1.2-5.3-vc6-nts.dll"
;xdebug configuration;xdebug配置

[Xdebug]
;开启自动跟踪
xdebug.auto_trace = On
;开启异常跟踪
xdebug.show_exception_trace = On
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
xdebug.remote_enable = On
;收集变量
xdebug.collect_vars = On
;收集返回值
xdebug.collect_return = On
;收集参数
xdebug.collect_params = On

?

?

比如我在 E:\EclipseWorkspace下放置所有的Eclipse工程,那么修改Apache/conf/httpd.conf,在文件结尾添加:

DocumentRoot "D:/PHPWorkSpace"
###Alias /Workspace? "D:/PHPWorkSpace"

?? Options Indexes MultiViews
?? AllowOverride None
?? Order allow,deny
?? Allow from all

?

这样做的好处是,所有php工程都共享一个apache配置(看下面如何设置)。

?

?

Pear的安装:

?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template