Open creamidea opened 7 years ago
brew install --without-apache --with-fpm php71
安装到这里 /usr/local/opt/php71(实际是在 /usr/local/Cellar/php71/$VERSION) 配置文件路径:/usr/local/etc/php/$VERSION
启动:php-fpm
brew install php71-xdebug
在 php.ini 最后或者在 conf.d/ext-xdebug.ini 中增加
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
;; default
;; xdebug.remote_host="localhost"
;; xdebug.remote_handler=dbgp
;; xdebug.remote_port=9009
brew install nginx
安装到 /usr/local/opt/nginx (实际在/usr/local/Cellar/nginx/1.12.1) 配置文件路径:/usr/local/etc/nginx
核心配置
location ~ \.php$ {
fastcgi_pass unix:/var/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
启动:nginx
停止:nginx -s stop
下载安装插件 PHP Debug。 之后你就可以欢快的打断点尽心调试啦。
祝玩的开心~
Using PHPStorm and Built-in Server