Ssh in your vm then do:
sudo apt-get install php5-mcrypt
So I've got Laravel Homestead set up, installed Composer and Laravel locally and have followed the set up videos by the letter.
I'm following the Larabook video and on the second episode, when installing the way/generators I'm getting the "Mcrypt PHP extension required" error.
I thought the whole point of having Homestead was so that I didn't need to install things like this locally? Or have I missed the point entirely?
I feel like I'm going out of my mind just getting this all set up. I'm by no means a PHP newb but the install process of this hasn't been very straight forward for me so far.
Any ideas? (I'm in a Mac, and can view the larabook example 'welcome' page via the larabook.app:8000 url)
Thanks all
Ssh in your vm then do:
sudo apt-get install php5-mcrypt
It's already there on the VM.
The issue is that I'm trying to develop the code locally but host it on the vm dev environment as per the tutorial.
When I run PHP artisan locally, that's when I get the error saying I need MCrypt installed.
ssh into the homestead box and do the commands there.
ssh vagrant@127.0.0.1 -p 2222
And then do all composer and php artisan commands while connected to the homestead box.
Well, now I feel stupid. I didn't realise the connection between the local and VM machines were two-way. From how the description reads, I thought the local machine is mirrored only.
That explains it! Thank you.
That's why using homestead is awesome because it means you don't have to install stuff like mcrypt on your native system. Glad it works.
alias vm='ssh vagrant@127.0.0.1 -p 2222'
Set that as an alias then all you do is "vm" when you want to do new commands.
When working on a project on a vm, I recommend executing all your commands in your VM. That way, your are assured that when you deploy your application, everything works.
I've got the SSH alias set up, I just couldn't figure out exactly what Homestead does and doesn't do. I had the impression artisan would hook into Homestead and do the changes on the VM automatically.
Thanks again for the replies.
I case you come to the point where you run your tests with selenium, don't forget that you can XFoward your browser session to your client sessions, so your browser will be launched outside the VM. This is very neat.
Guys, I still don't get this. Please help.
I had a laravel site running on my mac server, and I am trying to run it in a VM. I am getting the Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 error.
I ssh into the vm and ran the command sudo apt-get install php5-mcrypt and got this error The following packages have unmet dependencies: php5-mcrypt : Depends: phpapi-20121212
I am lost. Please help...
I just upgraded my Homestead vagrant box to v0.4.1 and was getting the error saying mcrypt is required. Homestead is now running PHP 7 so you can't use php5-mcrypt. I am still running Laravel 4.2 so not sure if Laravel 5.2 still uses mcrypt.
Anyways, I ran the following command and it fixed my issue.
sudo apt-get install php7.0-mcrypt
I tried to run
sudo apt-get install mcrypt php7.0-mcrypt
But getting error
Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/p/php7.0/php7.0-mcrypt_7.0.2-4+deb.sury.org~trusty+1_amd64.deb 404 Not Found [IP: 91.189.95.83 80]
Running
sudo apt-get update
sudo apt-get install mcrypt php7.0-mcrypt
sudo apt-get upgrade
Fixed the issue
Canfiax,
Sudo apt-get upgrade
gives me the same error:
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/o/openssl/libssl-doc_1.0.2e-1+deb.sury.org~trusty+1_all.deb 404 Not Found [IP: 91.189.95.83 80]
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/o/openssl/libssl-dev_1.0.2e-1+deb.sury.org~trusty+1_amd64.deb 404 Not Found [IP: 91.189.95.83 80]
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/o/openssl/openssl_1.0.2e-1+deb.sury.org~trusty+1_amd64.deb 404 Not Found [IP: 91.189.95.83 80]
Anyone any suggestions?
Same problem...
Likewise..
I was able to get this working by editing:
/etc/apt/sources.list.d/ondrej-php-7_0-trusty.list
and changing the source to this:
deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main
I figured this out based on this (now deleted) post from the maintainer: https://webcache.googleusercontent.com/search?q=cache:X3m8CmJDMDUJ:https://launchpad.net/~ondrej/%2Barchive/ubuntu/php-7.0+&cd=1&hl=en&ct=clnk&gl=ca
I also tried looking into committing a fix for this, but the Vagrant box for Homestead is captured (not generated) and can only be updated by the owner.
I am having the same problem. I cannot sudo apt-get update/upgrade even if i changed the /etc/apt/sources.list.d/ondrej-php-7_0-trusty.list file to the other source.
Getting this error: W: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/dists/trusty/main/source/Sources 404 Not Found [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
Any idears?
It looks like you didn't update the source list correctly, as it is still trying to pull from the outdated URL. Either that or you updated a different file than the one your homestead box is actually using.
in the URL: .../ondrej/php-7.0/ubuntu...
php-7.0 should be just php
Same problem as here, none of the suggested things solved it for me.
guys my problem was that i was using proxy!!!!!! disble your proxy,my problem solved with this!
A note for anyone having this problem with the latest Homestead, you now should do "sudo apt-get install mcrypt php7.0-mcrypt php7.1-mcrypt" because the latest Homestead now uses PHP 7.1.
I just did. You need to give access to root user. Then you login as root, you need to use wget:
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum update
sudo yum install php5-mcrypt
Please or to participate in this conversation.