我想使用Laravel 5.0创建一个项目,所以我输入了Problem 1
- laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.8 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.7 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.6 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.35 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.34 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.33 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.32 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.31 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.29 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.28 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.27 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.26 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.25 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.24 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.23 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.22 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.21 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.20 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.19 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.18 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.17 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.15 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.14 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.13 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.12 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.11 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.10 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.
- laravel/framework 5.0.30 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.
,但是它返回了**您的要求无法解决为一组可安装的软件包。
您的要求无法解决为一组可安装的软件包。
{{1}}
我不为什么会收到此错误,因为我的PHP版本是 7.4.8 ,而我刚刚下载并安装了Composer。
因此,如果您知道如何解决此问题,请告诉我,我将非常感谢...
thnak
答案 0 :(得分:10)
要使用ext-mcrypt
,您需要较旧的PHP版本(PHP> = 5.4,PHP <7)
使用旧PHP版本的一种方法是安装旧Xampp版本。我告诉你如何拥有两个自定义Xampps ...
首先确保当前的XAMPP和相关服务未运行。停止所有服务,例如Apache和MySQL,然后退出XAMPP控制面板。
导航到当前XAMPP安装所在的位置(通常为C :),然后将现有的“ xampp”文件夹重命名为其他名称。叫什么都无所谓,但我建议您将其命名为有意义的名称。例如,您可以在其后附加版本号,例如“ xampp-1.7.2”。
从here下载所需版本的XAMPP并正常安装,最好与步骤2中现有文件夹所在的位置相同。现在,您应该已安装两个版本的XAMPP。 / p>
然后取消安装作曲家,然后重新安装它,但是这次要包括php.exe
时指定xampp的旧版本
现在您可以创建Laravel 5.0项目:
composer create-project laravel/laravel your-project-name 5.0.*
答案 1 :(得分:1)
Windows:
如果您已经存在mcrypt扩展dll文件,这将起作用
php.ini
extension=mcrypt.so
如果不存在mcrypt。
根据您的php版本从下面的链接安装mcrypt dll文件 https://pecl.php.net/package/mcrypt/1.0.3/windows
将您的dll文件放置在位置F:\xampp\php\ext\
Ubuntu:
尝试通过以下命令安装mcrypt扩展,您需要根据您的php版本安装mcrypt
//check php version
php -v
//for php version 5
sudo apt-get install mcrypt
sudo apt-get install php5-mcrypt
//for php version 7.2
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl install mcrypt-1.0.1
sudo apt-get -y install php7.2-dev
sudo apt-get -y install libmcrypt-dev
在正确安装mcrypt之后,继续进行laravel安装
composer create-project laravel/laravel {directory} "5.0.*" --prefer-dist
有关Laravel 5.0 installation的laravel文档,请参见
答案 2 :(得分:0)
对于Windows,请转到您的php
安装的文件夹并编辑php.ini
添加或取消注释此行
extension=mcrypt.so
和
从https://windows.php.net/downloads/pecl/releases/mcrypt/1.0.3/php_mcrypt-1.0.3-7.4-nts-vc15-x64.zip下载php_mcrypt.so.dll
并放入xampp\php\ext\