无法在ubuntu上使用composer安装laravel 4


ubuntu@ip-10-252-31-19:/$ sudo curl -sS https://getcomposer.org/installer | sudo php
ubuntu@ip-10-252-31-19:/$ sudo mv composer.phar /usr/local/bin/composer
ubuntu@ip-10-252-31-19:/$ cd /home/user
ubuntu@ip-10-252-31-19:/home/user$ sudo wget https://github.com/laravel/laravel/archive/master.zip
ubuntu@ip-10-252-31-19:/home/user$ unzip master.zip
ubuntu@ip-10-252-31-19:/home/user$ cd laravel-master
ubuntu@ip-10-252-31-19:/home/user/laravel-master$ sudo composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
ubuntu@ip-10-252-31-19:/home/user/laravel-master$ sudo composer update
PHP Warning:  require(/home/user/laravel-master/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/user/laravel-master/bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/home/user/laravel-master/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/user/laravel-master/bootstrap/autoload.php on line 17
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning:  require(/home/user/laravel-master/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/user/laravel-master/bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/home/user/laravel-master/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/user/laravel-master/bootstrap/autoload.php on line 17
ubuntu@ip-10-252-31-19:/home/user/laravel-master$ sudo composer dump-autoload -o
Generating autoload files
ubuntu@ip-10-252-31-19:/home/user/laravel-master$ sudo composer update
PHP Fatal error:  Class 'PatchworkUtf8Bootup' not found in /home/user/laravel-master/bootstrap/autoload.php on line 46
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error:  Class 'PatchworkUtf8Bootup' not found in
/home/user/laravel-master/bootstrap/autoload.php on line 46

我花了相当多的时间玩,找不到任何关于这个问题的文档,我将诚实地说,我不知道足够的作曲家来解决这个问题。

编辑

我尝试了以下答案中建议的方法,但没有任何运气。

ubuntu@ip-10-252-31-19:/home/user$ sudo composer create-project laravel/laravel master
Installing laravel/laravel (v4.0.0)
  - Installing laravel/laravel (v4.0.0)
    Loading from cache
Created project in laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)
ubuntu@ip-10-252-31-19:/home/user$ ls
master
ubuntu@ip-10-252-31-19:/home/user$ cd master
ubuntu@ip-10-252-31-19:/home/user/master$ ls
app  artisan  bootstrap  composer.json  CONTRIBUTING.md  phpunit.xml  public  readme.md  server.php
ubuntu@ip-10-252-31-19:/home/user/master$ sudo composer install --no-scripts
Loading composer repositories with package information
Installing dependencies (including require-dev)
ubuntu@ip-10-252-31-19:/home/user/master$ ls
app  artisan  bootstrap  composer.json  CONTRIBUTING.md  phpunit.xml  public  readme.md  server.php
ubuntu@ip-10-252-31-19:/home/user/master$ sudo composer dump-autoload -o
Generating autoload files
ubuntu@ip-10-252-31-19:/home/user/master$ ls
app  artisan  bootstrap  composer.json  CONTRIBUTING.md  phpunit.xml  public  readme.md  server.php  vendor
ubuntu@ip-10-252-31-19:/home/user/master$ sudo tail /var/log/nginx/error.log
2013/06/06 15:50:56 [error] 20042#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'PatchworkUtf8Bootup' not found in /home/user/master/bootstrap/autoload.php on line 46"
 while reading response header from upstream, client: w.x.y.z, server: dom.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "dom.com"

我最近也有同样的问题。用--no-scripts标记运行composer。

composer update --no-scripts

这看起来像是你的编写器不工作,这通常是一个不兼容的PHP版本的特征。你的PHP是什么版本?Laravel要求>= 5.3.7

尝试更新PHP并通过发出以下命令重新运行composer

-add PHP5到apt-get库

sudo add-apt-repository ppa:ondrej/php5

-update your apt-get

sudo apt-get update

-重新安装PHP,确保用新版本覆盖当前版本!

sudo apt-get install php5-fpm php5-cli php5-cgi

重新启动nginx,然后在laravel目录下重新运行composer install

这是一个使用PHP单元在Ubuntu上安装Laravel 4的单行脚本http://irventu.com/installing-laravel-4-with-phpunit-composer/

我有同样的问题,这是为我工作:

  • 备份composer.json
  • 编辑comooser。并删除整个"scripts"块
  • 作曲家安装
  • 还原原始composer.json
  • 作曲家更新

似乎我们没有在裸安装上运行artisan所需的所有依赖项,但是一旦所有的东西都被composer获取了,它就会运行得很好。

您正在尝试运行composer update而不是首先运行composer install吗?

当我试图在另一台PC上运行我现有的项目时,我遇到了这个问题。

一旦我拉下我的项目git,我试图做一个composer update而不是首先运行composer install,这给了我同样的问题。

一旦我运行了composer install命令,我的项目下载并安装了各种所需的依赖项,没有任何进一步的问题。

您可以尝试composer update而不是composer install。根据文档http://laravel.com/docs/installation有一个更简单的方法安装laravel通过运行命令sudo composer create-project laravel/laravel nameofproject

在运行phpinfo之后,我注意到"——disable-mbregex"是PHP配置的一部分,这意味着PHP没有使用mbregex扩展进行编译。我的错误日志显示"调用未定义的函数mb_regex_encoding"。

一旦PHP用mb_regex_encoding重新编译,这个问题就消失了。

相关内容

  • 没有找到相关文章

最新更新