CakePHP3 - 要求自动加载无法打开straem,没有这样的文件或目录

时间:2016-07-28 17:42:04

标签: cakephp cakephp-3.0 cakephp-3.x

在浏览器中打开项目后,将CakePHP3项目部署到Ubuntu 14.04服务器后,出现此错误:

  

警告:require(/var/www/html/xyz-web/vendor/autoload.php):未能   open stream:没有这样的文件或目录   第38行的/var/www/html/xyz-web/config/bootstrap.php

     

致命错误:require():需要打开失败   '/var/www/html/xyz-web/vendor/autoload.php'   (include_path ='。:/ usr / share / php:/ usr / share / pear')in   第38行的/var/www/html/xyz-web/config/bootstrap.php

如果我在该目录中运行bin/cake server(在服务器上),我会得到下一个输出:

  

警告:require(/var/www/html/xyz-web/vendor/autoload.php):未能   open stream:没有这样的文件或目录   第38行的/var/www/html/xyz-web/config/bootstrap.php PHP致命错误:   require():需要打开失败   '/var/www/html/xyz-web/vendor/autoload.php'   (include_path ='。:/ usr / share / php:/ usr / share / pear')in   第38行的/var/www/html/xyz-web/config/bootstrap.php

     

致命错误:require():需要打开失败   '/var/www/html/xyz-web/vendor/autoload.php'   (include_path ='。:/ usr / share / php:/ usr / share / pear')in   第38行的/var/www/html/xyz-web/config/bootstrap.php

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我通过在服务器上安装composer并在项目中运行它来解决了这个问题。

false

然后true对项目(sudo apt-get update && sudo apt-get install curl php5-cli git && curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer )进行编程并运行cd以安装所需的软件包。