重新安装Laravel,使Mcrypt出现“错误". (OSX) [英] Fresh Laravel install giving Mcrypt "error". (OSX)
问题描述
我通过运行以下命令安装laravel:
I install laravel by running:
laravel new testing
它会回应:
应用程序就绪!构建惊人的东西.
Application ready! Build something amazing.
但是,当我访问public/index.php
时,它会显示一个空白页面,内容为:
Yet when I visit public/index.php
, it presents an empty page that says:
需要Mcrypt PHP扩展.
Mcrypt PHP extension required.
当我运行php -m
时,它不会列出Mcrypt.
When I run php -m
it does not list Mcrypt.
我尝试通过运行以下命令与composer进行安装:
I tried installing it with composer, by running:
composer create-project laravel/laravel laravel_composer --prefer-dist
结果如下:
Writing lock file
Generating autoload files
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output:
错误输出:"之后没有其他内容
There is nothing additional after "Error Output:"
推荐答案
OP解决方案.
我通过使用自制软件更新到php55和php55-mcrypt来解决了这个问题.
I resolved the issue by updating to php55 and php55-mcrypt using homebrew.
我在安装后出现冲突的php版本时遇到了问题,我通过编辑apache2 httpd.conf属性LoadModule php5_module
解决了此问题.通过取消注释并更改默认文件路径以查找local/php5-5.5.11-20140408-141340/libphp5.so
.
I had an issue with conflicting php versions post-install, which I resolved by editing the apache2 httpd.conf property LoadModule php5_module
. By uncommenting it and changing the default file path to look for local/php5-5.5.11-20140408-141340/libphp5.so
.
Mcrypt不再是一个问题,Apache正在查找正确的php.我要做的最后一件事是使用chmod -R o+w storage
Mcrypt was no longer an issue and apache was locating the correct php. The last thing I had to do was change the permissions of laravel_project/app/storage
using chmod -R o+w storage
这篇关于重新安装Laravel,使Mcrypt出现“错误". (OSX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!