簡體   English   中英

XDebug 未在 Windows 7 64 位 PHP 5.4 上加載

[英]XDebug not loading on Windows 7 64 bit PHP 5.4

我有 php 在 apache 上運行。我已經下載了我認為是正確的 xdebug 編譯 dll php 版本 5.4 64 位 windows。我啟用了線程安全並且它正在使用 VC9。 我已經下載了 dll 並將它放在這里:

C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll

這是我的 php.ini 中的內容:

[xdebug]
zend_extension = "C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"

當我啟動 Apache 時,出現以下錯誤:

[Wed Apr 04 17:01:56 2012] [notice] Parent: Received restart signal -- Restarting the server.
Failed loading C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll
hild process is ending.
[Wed Apr 04 17:01:56 2012] [notice] Apache/2.2.22 (Win32) PHP/5.4.0 configured -- resuming normal operations
[Wed Apr 04 17:01:56 2012] [notice] Server built: Jan 28 2012 11:16:39
[Wed Apr 04 17:01:56 2012] [notice] Parent: Created child process 2120
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Child process is running
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Acquired the start mutex.
[Wed Apr 04 17:01:57 2012] [notice] Child 2120: Starting 64 worker threads.
[Wed Apr 04 17:01:57 2012] [notice] Child 5624: Released the start mutex
[Wed Apr 04 17:01:58 2012] [notice] Child 5624: All worker threads have exited.
[Wed Apr 04 17:01:58 2012] [notice] Child 5624: Child process is exiting
Failed loading C:\php5\extras\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll

為了確保您下載了正確的二進制文件,您可以使用位於http://xdebug.org/wizard.php的向導,它會准確告訴您要下載哪個文件以及您應該將哪個 php.ini 文件放入其中zend_extension 行(當然,您現在使用的是正確的,因為您收到“加載失敗”錯誤)。

好的,它現在正在工作,我想我知道出了什么問題。 我使用的是 PHP 的 64 位版本,但 Apache 的 32 位版本和 xdebug 的 64 位版本。 我重新開始並使用 Apache 2.4 32 位,因為 php5 模塊似乎沒有 64 位版本。 所以,我確保我擁有所有的 32 位版本。 我在 VC9 中使用 php5.4,線程安全。

這篇博文有助於設置它: http://lifeofageekadmin.com/how-install-apache-2-4-php-5-4-and-mysql-5-5-21-on-windows-7/

我終於讓這個工作了。 按照 xdebug 網站上的說明,我使用向導將 dll 文件下載到“ext”目錄。 然后向導告訴我將這一行添加到我的 php.ini 文件中: zend_extension=ext\php_xdebug-2.3.3-5.6-vc11.dll

這給了我上面看到的錯誤: Failed loading ext\php_xdebug-2.3.3-5.6-vc11.dll

我還嘗試用正斜杠替換反斜杠,但這失敗了,並顯示消息: Failed loading ext\ext/php_xdebug-2.3.3-5.6-vc11.dll

查看最后一條消息,我想可能是擴展目錄導致了問題,我在我的 php.ini 文件中看到這一行: extension_dir = "ext"

所以我改為使用: zend_extension=php_xdebug-2.3.3-5.6-vc11.dll並且有效!

在最新版本的xampp中你只需要在php.ini中添加zend_extension=xdebug即可,例如:

zend_extension=xdebug
[XDebug]
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "c:\xampp\php"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_connect_back=on
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"

好的,我知道這是一個非常古老的僵屍線程,但最近我自己遇到了這個問題,結果證明它有一個簡單的解決方案。

PHP.INI 要求對目錄使用正斜杠,而在 windows 下給出的安裝 XDebug 的說明使用反斜杠。 所以對於上面的原始問題,解決方案是將 zend_extension 行更改為:

zend_extension = "C:/php5/extras/php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"

希望這可以幫助。

查看C:\php5\ext ,看看php_xdebug.dll是否已經存在。 如果沒有,請嘗試將php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll重命名為php_xdebug.dll並將其放置在C:\php5\ext中,然后將您的php.ini更改為:

[xdebug]
zend_extension = "C:\php5\ext\php_xdebug.dll"

有同樣的問題。 對我來說,我需要zend_extension的絕對路徑,在引號中(但反斜杠沒問題)。

我有 Windows 7 64 位和 php v5.4.4,但我需要下載的 x-debug 版本是:

PHP 5.4 VC9(32 位)(MD5:ffeb0215621d330fa53b249f0930ffae)

因為 IIS 無法使用 xdebug 64 位

還有我的 php.ini 說明:

[Xdebug]
zend_extension="C:\Program Files (x86)\iis express\PHP\v5.4\ext\php_xdebug-2.4.0rc4-5.4-vc9-nts.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "C:\temp\php"
xdebug.profiler_output_dir="C:\temp\php"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM