目前我正在学习Laravel的基本教程。我克隆了文件夹并运行composer安装。导致以下错误:http://pastebin.com/FijE9SN5.
这就是composer.json的样子:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r "copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
所以我在谷歌上搜索错误。我在stackoverflow上得到了一个答案,说我需要删除php.ini文件中ext-mbstring前面的分号。但它仍然不起作用。我现在一无所知。有人知道答案吗?
由于我的声誉,我无法发表评论,但您应该做的第一件事是按照错误中的说明进行操作。这样,你就应该检查php.ini中是否启用了ext-mbstring和ext-dom。你说你已经删除了ext-mbstring前面的分号,但你对dom扩展也这样做了吗?
此外,验证php-xml是否已安装,如下所示:
sudo apt-get install php-xml
好的,我修复了它,结果我必须运行
sudo apt-get install php-xml
就像ThePurpleK说的那样。我不得不运行
apt-get install php-mbstring.
无论如何,谢谢!