search
Homephp教程php手册php的eclipse环境搭建

php的eclipse环境搭建

Jun 06, 2016 pm 07:52 PM
eclipsephpgenerallyusedevelopbuildenvironment

php做开发一般使用常用的集成开发环境如xampp,wamp等就已经够用,但在某些环境如微信这样场景,就明显不够用了,因为它即使出错也不会返回错误信息。 烦恼良久,决定从我最熟悉的eclipse下手,搭一个本地调试环境。 准备工作: 1.下载Eclipse for PHP http:

       php做开发一般使用常用的集成开发环境如xampp,wamp等就已经够用,但在某些环境如微信这样场景,就明显不够用了,因为它即使出错也不会返回错误信息。

烦恼良久,决定从我最熟悉的eclipse下手,搭一个本地调试环境。

       准备工作:
       1.下载Eclipse for PHP  http://www.eclipse.org/downloads/
       2.下载Apache               http://httpd.apache.org/download.cgi   (想要windows版本的来这下 http://www.apachelounge.com/download/)
       3.下载php                      http://www.php.net/downloads.php
       4.下载xdebug           http://www.xdebug.org/download.php
       5.mysql数据库         这个基本是标配了      
        由于本地已经有了一个集成开发环境wamp,所以我是直接粘贴的apache和php,放在我的d盘的APM目录下面。下面来对它进行一些配置。
       
        如果是下载的apache,安装比较的简单,安装目录可选择d:/APM下,这个看自己喜欢起名。一路下一步,其中有一个地方就叫你添加三个地址,自己想好,按照例子填写。
我是写上 localhost.com  www.localhost.com  master@localhost.com。像我的直接粘贴的,后面再说。
       在d:\AMP\Apache2\conf 找到http.conf,  添加对php的支持

LoadModule php5_module D:/APM/php5/php5apache2.dll
AddType application/x-httpd-php .php
PHPIniDir "D:/APM/php5"

更改项目默认路径    


DocumentRoot "D:/www"

如果你是用Eclipse开发,要写到工作区。
DocumentRoot "D:\www"

你要访问地址是这样的http://localhost/www/*.php
在PHP安装目录D:\php找到php.ini-dist,将其命名为php.ini
   

下面来对eclpse做配置,
 上面下载的xdebug.dll拷到d:/APM/php/ext/下面,然后打开php.ini编辑
 

;onload Xdebug
zend_extension_ts="D:\APM\php5.4.16\ext\php_xdebug-2.2.5-5.5-vc11.dll"
;xdebug configuration
[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
自己替换下上面的路径。

进入Eclipse,从主菜单打开"Window > Preferences > PHP"。先选中"PHP Excutables"节点,在右面的面板点"Add"按钮,在接下来的窗口中,"Name"随便填,我命名为PHP5,"Excutable Path"浏览到你的php.exe,PHP ini file浏览到你的php.ini文件,PHP Debugger选XDebug。如果最新版会有一个SAPI TYPE,保持默认。
 
选中"PHP Servers"节点,在右面的面板点"New"按钮,在接下来的窗口中,"Name"随便填,"URL"填你的工作空间的URL(比如http://localhost/pdt)。这个其实在最新版可以不用设置,因为有一个默认的Server,你直接用就行。


自此,配置已基本完成。

  测试步骤,不懂的可以参考此文章
http://ekliu939.blog.163.com/blog/static/131368072201032801359548/ 

   

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft