使用未定义的常量MCRYPT_RIJNDAEL_128-假定为'MCRYPT_RIJNDAEL_128' [英] Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
问题描述
我已经成功安装了Laravel,但是在运行php artisan serve
并转到localhost:8000
之后,出现此错误:
I have successfully installed Laravel, but after running php artisan serve
and going to localhost:8000
I get this error:
使用未定义常量MCRYPT_RIJNDAEL_128-假定为'MCRYPT_RIJNDAEL_128'
Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128'
我已经检查了localhost:8888
上的phpinfo()
,它说mcrypt
已正确安装.但是我唯一能想到的是,也许我的道路是错误的?
I have checked phpinfo()
on localhost:8888
and it says that mcrypt
is properly installed. However the only thing I can think of is that maybe my path is wrong?
我的.bash_profile
我有
PATH=/usr/local/bin:$PATH
每次我尝试运行Laravel命令时,都必须在终端中键入以下内容:
Every time I try to run Laravel commands I have to type this in the terminal:
export PATH="~/.composer/vendor/bin:$PATH"
我在Mac上运行.有没有一种简单的方法可以设置bash_profile
,以便我可以在本地主机地址之间进行一致的更改,并使所有适当的PHP函数正常工作?
I am running on a Mac. Is there a simple way I can set up my bash_profile
so that I can consistently change between localhost addresses and still have all the proper PHP functions working?
推荐答案
此问题与PHP扩展加载程序有关. 成功安装后,您根本不需要使用laravel命令. Laravel框架需要用于安全模块的Mcrypt库并加密一些配置文件.
This problem relative to the PHP extensions loader. You no need to use laravel command at all after successful installation. Laravel framework need Mcrypt Library for the security module and encrypt some of configure file.
您需要的是这些步骤.
- 下载Mcrypt http: //sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
然后配置make并安装它.
then configure make and install it.
-
下载php http://php.net/releases/index.php 建议高于5.5.14. (稍后在第4步中使用此路径)
Download php http://php.net/releases/index.php Above 5.5.14 are suggested. (Use this path later on step 4)
然后下载自动配置
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar xvfz autoconf-latest.tar.gz
cd autoconf-2.69/
./configure
make
sudo make install
然后您必须进入目录级别
then you have to go to directory level
cd ***YOURPHPDIRECTORY***/ext/mcrypt/
并在此目录级别运行phpize
and run phpize within this directory level
/usr/bin/phpize
./configure
make
sudo make install
通过将其插入php.ini来修改php.ini以启用mcrypt扩展
modify your php.ini to enable the mcrypt extension by insert this into php.ini
extension=mcrypt.so
这篇关于使用未定义的常量MCRYPT_RIJNDAEL_128-假定为'MCRYPT_RIJNDAEL_128'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!