安裝xdebugphp
一、下載mysql
https://xdebug.org/download.php
找到PHP5.6對應的版本redis
https://xdebug.org/files/xdebug-2.5.5.tgz
二、解壓sql
sudo tar -zvxf xdebug-2.5.5.tgz -C /usr/local
三、進入shell
cd /usr/local/xdebug-2.5.5/
四、phpizejson
# sudo /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226
五、配置session
sudo ./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
六、安裝dom
sudo make sudo make test sudo make install
須要打開proc_open,shell_execcurl
$ sudo make test Build complete. Don't forget to run 'make test'. ===================================================================== PHP : /usr/local/php/bin/php PHP_SAPI : cli PHP_VERSION : 5.6.36 ZEND_VERSION: 2.6.0 PHP_OS : Linux - Linux JQ-Mac 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 INI actual : /usr/local/xdebug-2.5.5/tmp-php.ini More .INIs : CWD : /usr/local/xdebug-2.5.5 Extra dirs : VALGRIND : Not used ===================================================================== TIME START 2019-03-21 13:44:30 ===================================================================== No tests were run.
$ sudo make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ +----------------------------------------------------------------------+ | | | INSTALLATION INSTRUCTIONS | | ========================= | | | | See http://xdebug.org/install.php#configure-php for instructions | | on how to enable Xdebug for PHP. | | | | Documentation is available online as well: | | - A list of all settings: http://xdebug.org/docs-settings.php | | - A list of all functions: http://xdebug.org/docs-functions.php | | - Profiling instructions: http://xdebug.org/docs-profiling2.php | | - Remote debugging: http://xdebug.org/docs-debugger.php | | | | | | NOTE: Please disregard the message | | You should add "extension=xdebug.so" to php.ini | | that is emitted by the PECL installer. This does not work for | | Xdebug. | | | +----------------------------------------------------------------------+
七、配置php.inisocket
[Xdebug] zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so xdebug.auto_trace = on xdebug.default_enable = on xdebug.auto_profile = on xdebug.collect_params = on xdebug.collect_return = on xdebug.profiler_enable = on xdebug.remote_host = "127.0.0.1" xdebug.remote_port = 9000 xdebug.remote_handler = dbgp xdebug.trace_output_dir = "/usr/local/php/xdebug/" xdebug.profiler_output_dir = "/usr/local/php/xdebug/"
八、重啓lnmp
sudo lnmp restart
九、查看
$ php -moudle [PHP Modules] bcmath Core ctype curl date dom ereg filter ftp gd gettext hash iconv intl json libxml mbstring mcrypt mhash mysql mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix redis Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard sysvsem tokenizer xdebug xml xmlreader xmlrpc xmlwriter xsl Zend Guard Loader zip zlib [Zend Modules] Xdebug Zend Guard Loader
查看phpinfo