解壓Apache壓縮包到 D:\Program Files\Apache24
解壓PHP壓縮包到 D:\Program Files\php-7.1.12-Win32-VC14-x64
新建web根目錄 D:\phpphp
打開Apache配置文件httpd.conf修改:mysql
ServerRoot "D:/Program Files/Apache24" Listen 80 ServerAdmin admin@example.com 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可執行文件,雙擊運行web
打卡PHP目錄找到php.ini-development文件,把他改成php.ini修改:sql
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完成apache
XDebug安裝:
下載對應PHP版本的DLL,好比php_xdebug-2.5.5-7.1-vc14-x86_64.dll,放到PHP的ext目錄下,能夠用phpinfo()查看軟件版本
修改php.ini:php7
[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插件後能夠直接調試app