Coder Social home page Coder Social logo

Debug PHP about creamidea.github.com HOT 1 OPEN

creamidea avatar creamidea commented on June 24, 2024
Debug PHP

from creamidea.github.com.

Comments (1)

creamidea avatar creamidea commented on June 24, 2024

搭建 PHP 开发环境

PHP

安装 PHP

brew install --without-apache --with-fpm php71

安装到这里 /usr/local/opt/php71(实际是在 /usr/local/Cellar/php71/$VERSION)
配置文件路径:/usr/local/etc/php/$VERSION

启动:php-fpm

安装 xdebug

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

nginx

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

VSCode

下载安装插件 PHP Debug
之后你就可以欢快的打断点尽心调试啦。

尾声

祝玩的开心~

from creamidea.github.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.