首页 > 解决方案 > 如何设置 PhpStorm 来调试 OctoberCMS

问题描述

我试过调试栏,但这并没有给我足够的信息。

我还尝试使用与 Laravel 相同的方法设置 OctoberCMS 进行调试,但是当我设置断点时,它会停止在index.php. 另外,我尝试了 PhpStorm 中的验证脚本,但它给出了 404 错误。

我正在尝试调试我正在开发的插件,使用像 PhpStorm 或 NetBeans 这样的 IDE 会更容易。任何帮助,将不胜感激。

我已经通过在 PHP 网页设置中设置 URL:/phpstorm/public 来设置 phpstorm 来调试 laravel 项目,但是当我在 octobercms 项目中尝试一些类似的东西时,我得到的只是等待连接,这意味着断点永远不会被击中这是我正在使用的设置

xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port= 9000
xdebug.remote_autostart=1
xdebug.profiler_enable=1
xdebug.profiler_output_dir ="c:/wamp64/tmp/"
xdebug.idekey=PHPSTORM

在我的 PHP 网页中

起始 URL: /octobercms/backend/rainlab/blog/Posts 我没有在服务器中设置路径映射,因为 Laravel 项目没有这样做我正在使用具有以下设置的 WAMP64 c:/wamp64/www/octobercms/ ,这是我的虚拟主机文件

<VirtualHost *:80>
    ServerName octobercms.test
    DocumentRoot "c:/wamp64/www/octobercms"
    <Directory  "c:/wamp64/www/octobercms">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        DirectoryIndex index.php index.html
        Require local
    </Directory>
</VirtualHost>

关于我应该为 Octobercms 使用的设置的任何建议都会有所帮助

标签: phpstormoctobercms

解决方案


我不确定这是否有帮助,但经过几次尝试让它工作后,我设法让 phpstorm 在我通过以下选择的断点处停止

  1. 如上所述设置 wamp
  2. 在 PHP 网页部分,我将 Start URL: 设置为 /octobercms/backend/rainlab/blog/posts 并应用设置
  3. 在 Posts.php 中设置断点
  4. 按下运行按钮

一切都很好,我现在可以尝试弄清楚为什么我的插件没有做它应该做的事情。


推荐阅读