簡體   English   中英

在Ubuntu中安裝laravel時出錯

[英]getting error while installing laravel in ubuntu

我有PHP版本:

php -v
PHP 7.1.9-1

作曲者版本:

Composer version 1.5.2 2017-09-11 16:59:25

現在,我遇到了這個錯誤,由於我是這項技術的新手,所以我無法解決它。

 composer global require "laravel/installer"
    Changed current directory to /home/indous-ubuntu/.composer
    Using version ^1.4 for laravel/installer
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - laravel/installer v1.4.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
        - laravel/installer v1.4.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
        - Installation request for laravel/installer ^1.4 -> satisfiable by laravel/installer[v1.4.0, v1.4.1].

      To enable extensions, verify that they are enabled in your .ini files:
        - /etc/php/7.1/cli/php.ini
        - /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
        - /etc/php/7.1/cli/conf.d/10-opcache.ini
        - /etc/php/7.1/cli/conf.d/10-pdo.ini
        - /etc/php/7.1/cli/conf.d/15-xml.ini
        - /etc/php/7.1/cli/conf.d/20-calendar.ini

      You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

    Installation failed, reverting ./composer.json to its original content.

如果有人知道是什么問題,請幫助我!

提前致謝!

編輯composer.json文件並替換為

"require": {
    "laravel/framework": "4.2.*",
    "laracasts/commander": "~1.0",
    "laracasts/validation": "~1.0",
    "laracasts/presenter": "0.1.*"
},
"require-dev": {
    "way/generators": "~2.0"
},

此代碼的參考以及更多詳細信息

啟用您的php ext-zip lib。 用安裝

sudo apt-get install php7.0-zip為php版本7 sudo apt-get install php7.0-zip

正如錯誤中已明確描述的那樣,您缺少php-zip擴展名:

問題1-laravel / installer v1.4.1需要ext-zip *->系統中缺少所請求的PHP擴展zip。

嘗試使用以下命令安裝它(使用sudo ):

apt-get install php-zip

它將自動將其安裝為PHP7,作為Ubuntu存儲庫中PHP的默認版本。

PS:如果您已經安裝了php-zip,但是仍然無法正常工作,請將擴展名添加到/etc/php php.ini文件中,您就可以了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM