[英]Troubles with PhpStorm web server debug validation
在 PhpStorm 中,我正在嘗試調試遠程服務器上的代碼。 Web 服務器調試驗證一直告訴我無法訪問指定的 url (404)。
我的主機在windows下
我的服務器在 VirtualBox VM (Debian 9) 上
我在網絡驅動器V:
指向我的 VM 的/var/www/
文件夾上使用 PhpStorm 編輯代碼。 這不是 VirtualBox 共享文件夾(不支持 Debian 9)。 因此,當我處理V:\myproject
時,我實際上是通過 smb 在 VM 上處理/var/www/myproject
。
我遵循了很多教程,但從未成功。 目前,我有以下配置:
/var/www/myproject
。 Web 服務器 url 是https://my.project.local
(url 在我的瀏覽器中測試過)V:\myproject
/
/pub
(本項目為Magento 2應用,pub為網頁根目錄) 當我嘗試驗證 web 服務器調試時,我選擇“遠程 Web 服務器”,創建驗證腳本的路徑是V:\myproject\pub
,部署服務器是前面描述的部署配置。
驗證失敗,顯示“無法訪問指定的 URL,原因是:‘請求失敗,狀態代碼為 404’”。
有沒有人已經通過這個特定的設置? (PhpStorm + VirtualBox VM + SFTP 連接上的遠程調試)。 你成功了嗎? 也許我應該嘗試另一種方法讓它發揮作用? 幫助將不勝感激!
有點晚了,但對於碰巧在 Nginx 上運行 Magento 2 的其他人來說,請查看nginx.conf.sample或您正在使用的任何 ngxin.conf 。
找到以下塊:
# PHP entry point for main application
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
try_files $uri =404;
fastcgi_pass fastcgi_backend;
fastcgi_buffers 1024 4k;
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
像這樣修改它,允許 Nginx 提供驗證腳本:
# PHP entry point for main application
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check|_intellij_phpdebug_validator)\.php$ {
try_files $uri =404;
fastcgi_pass fastcgi_backend;
fastcgi_buffers 1024 4k;
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.