"run on server" 的 Eclipse 作曲家问题,"PHP CLI Application" 正常

Eclipse with composer problem with "run on server", ok with "PHP CLI Application"

嗨,我有一个项目使用 composer 来处理 mongo 库,如果我使用 "test cli application" 作为控制台应用程序进行调试,它工作正常,只要我尝试 运行它作为 "run on server" 它 "looses" autoload.php。服务器是原生eclipse的php服务器

我的项目目录树是:

D:\EclipseWorkspace-GIT\mongowithcomposer 
├───src
│   ├───MongoHandler
│   ├───WebContent
│   │   ├───js
│   │   ├───resources
│   │   │   └───images
│   │   ├───DEFINITIONS.PHP
│   │   ├───HOME.PHP
│   │   └───style
│   └───XML-Handler
├ COMPOSER.JSON
├ COMPOSER.LOCK
└───vendor
    ├───composer
    ├───    AUTOLOAD.PHP
    └───mongodb
        └───mongodb
            ├───.github
            │   └───ISSUE_TEMPLATE
            ├───.phpcs
            ├───.travis
            ├───docs
            │   ├───.static
            │   ├───includes
            │   ├───reference
     .......

这是我得到的错误:

Warning: require_once(D:\Eclipse-Workspace-GIT\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\mongowithcomposer\autoload.php): failed to open stream: No such file or directory in D:\Eclipse-Workspace-GIT\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\mongowithcomposer\definitions.php on line 10

注意:在树输出中,文件以大写形式突出显示

编辑: 这是服务器自动路径映射:

<Server>
    <Port name="HTTP/1.1" protocol="HTTP">8181</Port>
    <PathMapping local="/mongowithcomposer/vendor/composer" module="mongowithcomposer" remote="D:\Eclipse-Workspace-GIT\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\mongowithcomposer"/>
    <PathMapping local="/mongowithcomposer/src" module="mongowithcomposer" remote="D:\Eclipse-Workspace-GIT\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\mongowithcomposer"/>
    <PathMapping local="/mongowithcomposer/vendor/mongodb/mongodb/src" module="mongowithcomposer" remote="D:\Eclipse-Workspace-GIT\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\mongowithcomposer"/>
</Server>

这是 PDT 错误。在当前的实现中,不仅仅是 运行 php -S 它将 .buildpath 目录复制到单独的目录中,然后 运行 server.

我计划在 Eclipse 2020-09 中修复此问题,并且已经为此准备了问题:https://github.com/eclipse/pdt/issues/68