Mcrypt PHP extension required. laravel安装,出现这错误


php artisan migrate:make create-users-table


Mcrypt PHP extension required. 

但通过phpinfo() 查看,Mcrypt 是启用的。主要原因是缺少PATH 配置,按如下方法可以解决。

 those that uses XAMPP 1.7.3 and Mac

  1. Go to Terminal
  2. Enter which php
    • If it says /usr/bin/php, then proceed to 3.
  3. Enter sudo nano ~/.bash_profile (or sudo vim ~/.bash_profile if you know how to use it)
  4. Then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
  5. Ctrl+O then enter to save, then Ctrl+X to exit.
  6. Type cd ~
  7. type . .bash_profile
  8. restart terminal.
  9. Enter which php. If you did it right, it should be the same as the path in #4.

The reason for the mcrypt error is because your Mac uses its native php, you need to change it to the one xampp has.

P.S. I'd recommend using MAMP for Laravel 4 for Mac users, this issue will get resolved along with the php file info error without a sweat, and the php version of xampp is so outdated.



linux 下执行 php artisan help:commands 命令,提示 Could not open input file: artisan 错误

首先 artisan 是 Laravel 项目下的指令文件,在Laravel 项目的根目录下可以看到artisan文件。

所以首先要建立 Laravel 项目。
如果已经建立项目需要CD到项目的目录下执行 artisan 命令。



你可能感兴趣的:(PHP)