【问题标题】:error while launching the php server for zend application为zend应用程序启动php服务器时出错
【发布时间】:2020-04-06 07:36:23
【问题描述】:

我从here 下载了zend 骨架应用程序。然后我通过执行以下命令安装它。

cd Desktop/zendprojects
git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
composer self-update
composer install

然后我决定在本地启动它,所以我执行了这个命令:

php -S 0.0.0.0:8080 -t public/ public/index.php

我得到了这个错误:

Directory public/ does not exist.  

我检查了项目结构,public 目录存在于文件结构中。我该如何解决?

【问题讨论】:

  • 如您所见,您将public 目录指定为基础目录,因此它将在 public 中查找另一个不存在的 public 目录。 php -S 0.0.0.0:8080 -t public/ 应该够了。
  • 我遇到了同样的错误;即Directory public/ does not exist.
  • 对不起,它似乎在这两种情况下都有效,这使得我的假设是错误的:(。但现在我注意到你在 Windows 中,因此你可能需要使用反斜杠 `\`。php -S 0.0.0.0:8080 -t public\public\index.php
  • 反斜杠不走运。同样的错误

标签: php zend-framework2 windows-8.1


【解决方案1】:

使用这个:

php -S 0.0.0.0:8080 -t public public/index.php

【讨论】:

    【解决方案2】:

    不带“-t”试试:php -S 0.0.0.0:8080 public\public\index.php

    【讨论】:

      【解决方案3】:

      如果您在 Windows 上,请在安装了应用程序的文件夹中尝试此操作:

      php -S 0.0.0.0:80 -t .\public public/index.php
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-07-22
        • 2020-08-14
        • 2011-04-12
        • 1970-01-01
        • 2015-08-18
        • 1970-01-01
        相关资源
        最近更新 更多