2012-04-14 47 views
5

Tôi đã cố gắng kích hoạt Xdebug cho Mac OS X Lion, nhưng không thể làm cho nó hoạt động. Điều này nên được khá thẳng về phía trước nhưng nó chỉ là không làm việc cho tôi.Bật Xdebug trên Mac OS X Lion

Đây là những bước tôi mất:

1 - không chú thích dòng này của file php.ini:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 

2 - Khởi động lại Apache Server của tôi với

sudo apachectl restart 

3 - Kiểm tra xem nó có được kích hoạt thông qua hàm phpinfo() hay không. Đó là trong thực tế kích hoạt cả hai như mô-đun Zend và như là một mô-đun riêng biệt.

Nhưng nó không hoạt động. Mỗi khi một lỗi xảy ra trong các tập lệnh php của tôi, chúng được hiển thị bằng cách sử dụng xử lý lỗi xấu xí theo mặc định. var_dumps cũng không hoạt động.

Tôi có thiếu một bước không?

Trả lời

7

Đảm bảo html_errorsdisplay_errors của bạn được bật thông qua tệp php.ini của bạn.

+0

Oh my god ... đó là nó. Tôi đã không kích hoạt html_errors. Cảm ơn bạn rất nhiều Mike. Bây giờ tôi cảm thấy ngớ ngẩn ... –

+1

Điều đó xảy ra với chúng ta. –

+0

Tôi mới ở đây, Mike. Rất tiếc là tôi không thể bỏ phiếu cho câu trả lời của bạn. Nhưng cảm ơn nhiều bạn! –

3

Tôi cũng vậy.

Tôi đã có thể kích hoạt nó bằng MAMP trước đây. Dù sao môi trường này tạo ra vấn đề và tôi đã cài đặt một mysql độc lập và kích hoạt apache Mac OS Lion.

tôi đã biên dịch lại xdebug.so và sửa đổi /private/etc/php.ini:

;... 
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 
;... 
[xdebug] 
;xdebug.idekey="macgdbp" 
xdebug.remote_enable=1 
xdebug.remote_handler="dbgp" 
xdebug.remote_host=127.0.0.1 
xdebug.remote_port=9000 
xdebug.remote_log="/var/log/xdebug.log" 
xdebug.remote_autostart=1 

Nhưng không có gì tôi có thể làm là, tôi không thể nhận được NetBeans 7.1 gắn vào trình gỡ lỗi.

Điều gì tôi bị thiếu?

php-config đầu ra:

$ php-config --help 
Usage: /usr/bin/php-config [OPTION] 
Options: 
    --prefix   [/usr] 
    --includes   [-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib] 
    --ldflags   [ ] 
    --libs    [-lresolv -lz -lexslt -ltidy -lresolv -ledit -lncurses -lpq -lpq -liodbc -lldap -llber -liconv -liconv -lfreetype -lpng -lz -ljpeg -lcrypto -lssl -lcrypto -lcurl -lbz2 -lz -lpcre -lcrypto -lssl -lcrypto -lm -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -licucore -lm -liodbc -lxml2 -lz -licucore -lm -lnetsnmp -lcrypto -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxslt -lxml2 -lz -licucore -lm ] 
    --extension-dir  [/usr/lib/php/extensions/no-debug-non-zts-20090626] 
    --include-dir  [/usr/include/php] 
    --man-dir   [/usr/share/man] 
    --php-binary  [/usr/bin/php] 
    --php-sapis   [cli apache2handler] 
    --configure-options [--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-dba --enable-ndbm=/usr --enable-exif --enable-ftp --with-gd --with-freetype-dir=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --enable-gd-native-ttf --with-icu-dir=/usr --with-iodbc=/usr --with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-mysqli=mysqlnd --without-pear --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --with-readline=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-suhosin --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --enable-zend-multibyte --enable-zip --with-pcre-regex=/usr --with-pgsql=/usr --with-pdo-pgsql=/usr] 
    --version   [5.3.10] 
    --vernum   [50310] 
+0

Đáng kinh ngạc! Đã viết sai một chuỗi: xdebug.remote_handler = "dbgp" – gsscoder

Các vấn đề liên quan