Are you using artisan serve or another web server?
laravel mcrypt
Hi , I am having a weird issue.
I have installed laravel on my new box. The installation went fine. Laravel didn't error out with the Mcrypt issue. However whenever I am on the site, I get this white page with the error : Mcrypt PHP extension required.
I am using nginx and I have already followed this http://stackoverflow.com/questions/25117912/mcrypt-php-extension-required
I did run php -m - mcrypt is listed there.
I have also cleared my browser cache.
Can you please help me get out of this issue?
thanks
nginx - sorry about that . I should have said that in my question itself. did that - just now. thanks
Have you checked if it's loaded in php.ini?
I'm assuming you are using Ubuntu since the link you mentioned mentions it, so check this person's comment on the Ubuntu bug about it: https://bugs.launchpad.net/ubuntu/+source/php-mcrypt/+bug/1241286/comments/6
Try to run
var_dump(get_loaded_extensions());
and post the result.
@nesl247 I did do this php -m | grep mcrypt and it returned mcrypt .. so that would mean that its enabled , right ? do i still need to go further with the link ?
@gj1118 php -m is only showing you modules that were compiled in, not ones that are loaded. So yes, you would still need to follow that link.
array(47) { [0]=> string(4) "Core" [1]=> string(4) "date" [2]=> string(4) "ereg" [3]=> string(6) "libxml" [4]=> string(7) "openssl" [5]=> string(4) "pcre" [6]=> string(4) "zlib" [7]=> string(6) "bcmath" [8]=> string(3) "bz2" [9]=> string(8) "calendar" [10]=> string(5) "ctype" [11]=> string(3) "dba" [12]=> string(3) "dom" [13]=> string(4) "hash" [14]=> string(8) "fileinfo" [15]=> string(6) "filter" [16]=> string(3) "ftp" [17]=> string(7) "gettext" [18]=> string(3) "SPL" [19]=> string(5) "iconv" [20]=> string(8) "mbstring" [21]=> string(5) "pcntl" [22]=> string(7) "session" [23]=> string(5) "posix" [24]=> string(10) "Reflection" [25]=> string(8) "standard" [26]=> string(5) "shmop" [27]=> string(9) "SimpleXML" [28]=> string(4) "soap" [29]=> string(7) "sockets" [30]=> string(4) "Phar" [31]=> string(4) "exif" [32]=> string(7) "sysvmsg" [33]=> string(7) "sysvsem" [34]=> string(7) "sysvshm" [35]=> string(9) "tokenizer" [36]=> string(4) "wddx" [37]=> string(3) "xml" [38]=> string(9) "xmlreader" [39]=> string(9) "xmlwriter" [40]=> string(3) "zip" [41]=> string(3) "PDO" [42]=> string(4) "curl" [43]=> string(4) "json" [44]=> string(8) "readline" [45]=> string(5) "mhash" [46]=> string(12) "Zend OPcache" }
Search in your php.ini for a line containing
extension=php_mcrypt.so
if it's commented (starts with a semicolon ;) uncomment it and restart nginx.
It did not exist. I have added that and restarted the nginx server. but to no avail.
If you are using php-fpm make sure you restarted also that.
restarting php-fm did make that error go away. but now i am getting a very vague Error in exception handler. nothing else is being shown.http://104.131.37.52/ . the logs folder is still empty..
try to change the line to
extension=mcrypt.so
and restart again, sorry if but with the information you gave we have to go by trial and error.
that is ok . your help is indeed praiseworthy.. i did that , and i am getting the same issue. i restarted both php-fm and the nginx services
Uhm... How did you install everything?
https://www.digitalocean.com/community/tutorials/how-to-install-laravel-with-nginx-on-an-ubuntu-12-04-lts-vps .. for my first droplet this worked.. but for my second this is a becoming in huge pain ...
I am going to destroy that droplet and going to create another one , just to start afresh ..
before try this
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
And then restart everything
Try chmoding the storage folder
sudo chmod -R 777 app/storage
I don't think it's that, since when he ran this get_loaded_extensions() mcrypt didn't show up in the array.
Try running this command, it will tell PHP5 to enable mcrypt.
sudo php5enmod mcrypt
@Francesco Zaffaroni did that as well.. it did not work . same thing. @others I have tried doing what you have suggested but the box will not simply work. Out of sheer frustration i pressed the bug huge red button and destroyed the box. Going ahead to press the small green button to create the droplet and try it again. Will keep you guys posted
@Francesco Zaffaroni yeah, but that was before he said that restarting php-fpm made the error go away and get a blank screen with no logs :)
From my experience at digital ocean with laravel, those are the first two errors I get, first mcrypt (solved by installing and restarting) and then a blank screen with no log (solved by giving permission to the storage folder)
@henrique sorry, didn't realize that :/
@gj1118 after you install if the problem is the same do this http://askubuntu.com/questions/460837/mcrypt-extension-is-missing-in-14-04-server-for-mysql and what henrique said before touching anything else.
Guys, I managed to resolve the issue. The issue was (what no sane mind would do ) I was not setting the correct php.ini . The correct php.ini is in the php-fpm folder while I was modifying the one in the cli folder. Phew .. it was a long day ! Nuclear launch aborted !
JFYI, you could check extension by the command php --ri : php --ri mcrypt
Been there, done that @gj1118... Glad you figured it out.
You should mark your last response as the answer. :)
@amaille you probably should take a look at Forge (https://forge.laravel.com/). It's quite awesome in setting up a Laravel environment on providers like DigitalOcean.
Please or to participate in this conversation.