Eclipse PHP环境筹建
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
?>
记得重新启动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的安装:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an
