Heim  >  Artikel  >  Backend-Entwicklung  >  windows下安装php及筹建debug环境

windows下安装php及筹建debug环境

WBOY
WBOYOriginal
2016-06-13 12:25:45888Durchsuche

windows下安装php及搭建debug环境
安装apache2.4
官方地址:http://httpd.apache.org/
如果选择2.2官方会编译好,选择2.4,要从其他镜像下载
Files for Microsoft Windows
然后选择ApacheHaus
然后下载v11_x64版本

修改配置httpd.conf
1.修改ServerRoot到安装目录
2.修改DocumentRoot到htdocs

php5.6.14基础安装
官方地址:http://php.net/
到官方地址下载v11_x64_线程安全版本
1.php配置文件修改:将php.ini-development修为php.ini
2.apache配置文件修改httpd.conf:在apache的配置文件尾部,追加
# php5 support,其中路径要用斜杠,LoadModule和PHPIniDir修改为自己对应的目录
LoadModule php5_module C:/ide/php/php-5.6.14/php5apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "C:/ide/php/php-5.6.14"

php的xdebug2.3.3安装
官方地址:http://xdebug.org/
下载PHP 5.6 VC11 TS (64 bit) ,并拷贝php_xdebug-2.3.3-5.6-vc11-x86_64.dll到php安装目录的下面
修改php.ini文件,末尾追加,其中注意zend_extension,zend_extension_ts,extension。只配置zend_extension即可,其他不生效。
zend_extension = C:/ide/php/php-5.6.14/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll
;zend_extension_ts = C:/ide/php/php-5.6.14/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll
;extension=php_xdebug-2.3.3-5.6-vc11-x86_64.dll
[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的debug配置
1.配置eclipse,修改PHP Excutables,把php安装目录配置上
同时修改PHP Excutables的子目录,Execution Environments,把5.6勾上
2.修改PHP/Debug/Debuggers的XDebug
3.修改PHP/Servers/Default PHP Web Server里面的端口,和htdocs
4.修改PHP/Debug,吧刚才设置的Excutables和Debuggers设置上
其中有个概念很重要,远程调试,服务器是eclipse,apache会主动来连接eclipse指定的IP和端口。apache里,默认远程端口是9000,地址是localhost。


后语
添加模块,从php.ini第849行开始
其中ts表示线程安全,nts表示线程不安全。
移动要注意版本的匹配,否则调试不通。
后续会上图,把eclipse的配置贴出来

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn