2017-07-03 42 views
3

我從作曲家處獲得的錯誤消息是: 您的需求無法解析爲可安裝的一組軟件包。請求的PHP擴展mbstring在您的系統中缺失

Problem 1 
    - Installation request for laravel/framework v5.4.28 -> satisfiable by laravel/framework[v5.4.28]. 
    - laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. 
    Problem 2 
    - Installation request for phpunit/phpunit 5.7.21 -> satisfiable by phpunit/phpunit[5.7.21]. 
    - phpunit/phpunit 5.7.21 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. 
    Problem 3 
    - laravel/framework v5.4.28 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. 
    - laravel/tinker v1.0.1 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.4.28]. 
    - Installation request for laravel/tinker v1.0.1 -> satisfiable by laravel/tinker[v1.0.1]. 

我試圖取消對擴展=中php_mbstring.dll但仍引發錯誤。我試圖改變「php.ini」中的extension_dir,它給出了一個錯誤。幫助表示讚賞。

+0

昨天有同樣的問題,安裝它解決了它。但首先你應該指定你正在運行的是哪個操作系統。對我來說,它是centOS:'yum install php70w-mbstring',但對於最常見的:https://stackoverflow.com/questions/34471633/cannot-initialize-mbstring-with-php-7 –

+0

你是否設置了PHP的環境變量在你的系統中? –

+0

我正在使用Windows,我試圖取消註釋擴展名= php_mbstring.dll不幸的是,它不起作用,因爲某種原因 –

回答

7

- 編輯根據新信息 -

由於這是Windows上,重新安裝PHP,使在php.ini文件擴展名,並重新啓動Web服務器,應該工作。

- FOR LINUX以前的解決方案 -

您需要安裝MBSTRING爲PHP。

用途:

sudo apt-get install phpX.X-mbstring 

其中x.x代表PHP的版本號。

+0

我在命令提示符下使用windows這是cmd無法識別的Linux命令 –

+0

好的,如果您取消註釋擴展名,您是否重新啓動了網絡服務器? – TBowman

+0

我做過了,但是在php -m命令中我沒有看到mbstring,所以重新安裝php和composer沒有工作 –