2019独角兽企业重金招聘Python工程师标准>>>
解压Apache压缩包到 D:\Program Files\Apache24
解压PHP压缩包到 D:\Program Files\php-7.1.12-Win32-VC14-x64
新建web根目录 D:\php
打开Apache配置文件httpd.conf修改:
ServerRoot "D:/Program Files/Apache24"
Listen 80
ServerAdmin [email protected]
ServerName www.example.com:80
DocumentRoot "D:/php"
PHPIniDir "D:/Program Files/php-7.1.12-Win32-VC14-x64"
LoadModule php7_module "D:/Program Files/php-7.1.12-Win32-VC14-x64/php7apache2_4.dll"
AddType application/x-httpd-php .php
以上配置Apache完成
打开CMD窗口安装Apache服务,输入:"D:\Program Files\Apache24\bin\httpd.exe" -k install
找到D:\Program Files\Apache24\bin\ApacheMonitor.exe可执行文件,双击运行
打卡PHP目录找到php.ini-development文件,把他改为php.ini修改:
extension_dir = "D:/Program Files/php-7.1.12-Win32-VC14-x64/ext"
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysqli.dll
以上配置PHP完成
XDebug安装:
下载对应PHP版本的DLL,比如php_xdebug-2.5.5-7.1-vc14-x86_64.dll,放到PHP的ext目录下,可以用phpinfo()查看软件版本
修改php.ini:
[xdebug]
zend_extension="D:/Program Files/php-7.1.12-Win32-VC14-x64/ext/php_xdebug-2.5.5-7.1-vc14-x86_64.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
XDebug安装成功后会在phpinfo()的打印信息中显示“xdebug”栏目
VSCode安装phpdebug插件后可以直接调试