[英]Howto ubuntu 18.04 install / activate PHP extension ext-mcrypt
[英]ext-mcrypt error while installing laravel on ubuntu 14.04
我是初學者在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
這成功運行了。
任何方式再次感謝。
這就是我在Mac Yosemite上解決的問題。 我在/ etc /中有一個php.ini,我有mcrypt instaIled。 但我遇到了同樣的問題。
運行此命令以查找另一個php.ini。
php -i|grep ini
它返回了以下內容。
System => Darwin Myname-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Configuration File (php.ini) Path => /usr/local/etc/php/5.5
Loaded Configuration File => /usr/local/etc/php/5.5/php.ini
....
我打開/usr/local/etc/php/5.5/php.ini並將extension=mcrypt.so
添加到該文件中。
我希望這將有助於將來的某些人。
使用brew的Mac用戶只能在CLI中運行:
brew install php56-mcrypt
Doinion戒指。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.