talyssonoc / react-laravel

Package for using ReactJS with Laravel
895 stars 90 forks source link

Better instructions for setup/installation on Vagrant/Homestead #45

Closed ravenwilde closed 8 years ago

ravenwilde commented 8 years ago

I've been having a hell of a time getting this to work in a Homestead box... do I simply follow this:

Install v8js on Linux (works with Homestead)

First run:

$ sudo apt-get install libv8-dev g++ $ sudo pecl install v8js-0.1.3 Then add extension=v8js.so to your php.ini file.

It seems like there must be more to it than this - also, wouldn't I need to provision this somehow in my Vagrantfile?

TomCaserta commented 8 years ago

There isnt more to it than that if you want the older v8js version just for a non production environment (its slightly slower!).

You can probably expand that a bit more with:

$ sudo touch /etc/php5/mods-available/v8js.ini
$ sudo echo "extension=v8js.so" > /etc/php5/mods-available/v8js.ini
$ sudo php5enmod v8js
$ sudo service php5-fpm restart

That being said if you want the latest version of v8js there is of course more to it and its an absolute pain to install on any machine. It takes a good hour and there is a few options that I cant name off the top of my head that the v8js installation page misses off which causes the make/tests/installation to fail only after you've waited the entire hour.

Im not entirely understanding what you mean via also, wouldn't I need to provision this somehow in my Vagrantfile? I guess you could, I've not looked at how vagrant works personally with the whole provisioning. You are running these commands on the homestead machine right and not on your host machine?

ravenwilde commented 8 years ago

So... I've done a lot of research/reading over the last few days and gotten everything to work on my Homestead instance. Although, really, we should generate some better Vagrant/Homestead specific instructions for other people. Anyway...

Im not entirely understanding what you mean via also, wouldn't I need to provision this somehow in my Vagrantfile? I guess you could, I've not looked at how vagrant works personally with the whole provisioning. You are running these commands on the homestead machine right and not on your host machine?

Basically, every time you launch a vagrant box (which Homestead is) you have to provision it, which just means that a set of instructions are run that set up the virtual environment. If the box gets destroyed then a new one has to be relaunched and the provisioning has to take place all over again - which means installing the v8lib and php-v8js again (ugh).

I've written a bash script provisioner based off the Linux instructions (which I followed to get v8lib and php-v8js working on Homestead). Once I'm through testing it I will post it here.

talyssonoc commented 8 years ago

Thanks, @ravenwilde, the provisioner would be great! I guess we could put it somewhere in the repository, so users wanting to use react-laravel with Homestead would just call this provisioner from inside ther vagrant provition script?

rasmuswoelk commented 8 years ago

Hi. I'm having issues with this. Any news on that provisioner? :+1: