由于项目需求,需要用PHP建立个简单查询系统,没想到在搭建PHP开发环境时,就非常抓狂,经过网上博客教学等,在此为搭建环境写个总结。
软件
Eclipse
下载链接:http://www.eclipse.org/downloads/
jdk下载安装什么的应该就不用说了吧
Wampserver
下载链接:http://www.wampserver.com/en/#download-wrapper
什么用:包含PHP开发调试环境,不需要去单独下载和配置apache,php,xdebug,mysql等
过程
1.直接安装Eclipse与wampserver
2.配置wampserver
用notepad打开C:\wamp\bin\apache\Apache2.4.33\bin下的php.ini,
找到最后几行中
[xdebug]
zend_extension =”c:/wamp64/bin/php/php5.6.35/zend_ext/php_xdebug-2.5.5-5.6-vc11-x86_64.dll”
xdebug.remote_enable = on
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = on
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir =”c:/wamp64/tmp”
xdebug.show_local_vars=0
3.配置Eclipse
进入eclipse时选择工作区一定要选择在wamp的www目录,才能便于调试
进入界面后,在中间选择add PHP Executable,如图添加php.exe与php.ini
配置PHP server,设置默认就好
配置PHP debug
Apply and close