xdebug的php作用有很多,我使用的原因是可以結合phpunit,通過單元測試檢視程式碼覆蓋率,作為自測參考。
安裝步驟如下,其實就是原始碼目錄中的READ檔案內容(任何開原始碼的README檔案都很有必要讀讀),十分簡單,希望對你有用,
1. Unpack the tarball: tar -xzf xdebug-2.2.x.tgz. Note that you do
not need to unpack the tarball inside the PHP source code tree.
Xdebug is compiled separately, all by itself, as stated above.
2. cd xdebug-2.2.x
3. Run phpize: phpize
(or /path/to/phpize if phpize is not in your path).
4. ./configure –enable-xdebug (or: ../configure –enable-xdebug
–with-php-config=/path/to/php-config if php-config is not in your
path)
5. Run: make
6. cp modules/xdebug.so /to/wherever/you/want/it
7. add the following line to php.ini:
zend_extension=”/wherever/you/put/it/xdebug.so”
8. Restart your webserver.
9. Write a PHP page that calls “phpinfo();” Load it in a browser and
look for the info on the xdebug module. If you see it, you have been
successful!