gpt4 book ai didi

php - 在 ubuntu 14.04 上安装 laravel 时出现 ext-mcrypt 错误

转载 作者:行者123 更新时间:2023-12-03 01:03:02 25 4
gpt4 key购买 nike

我是 ubuntu 14.04 中的 laravel 初学者。我尝试运行以下命令来安装 laravel。

composer create-project laravel/laravel --prefer-dist

我收到以下错误。我也尝试安装 ncrypt 但遇到了同样的错误。

Installing laravel/laravel (v5.0.1)
- Installing laravel/laravel (v5.0.1)
Loading from cache

Created project in /opt/lampp/htdocs/laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[v5.0.0, v5.0.1, v5.0.2].

我也尝试运行这个命令,但我得到了同样的错误。

sudo apt-get install mcrypt php5-mcrypt
sudo php5enmod mcrypt
sudo service apache2 restart

提前致谢..

最佳答案

我正在打开这个文件

gedit /etc/php5/cli/php.ini

在此文件中放入一行

extension=mcrypt.so

并且运行成功。

再次感谢。

关于php - 在 ubuntu 14.04 上安装 laravel 时出现 ext-mcrypt 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28406605/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com