strange error when trying to install laravel homestead - php

I am following an online training course which is showing me how to install laravel, I am having trouble installing homestead, I followed the instruction to download Vagrant and Virtualbox which I have done. Then I am told to run a terminal command:
$ vagrant box add laravel/homestead
I get the following strange message:
/opt/vagrant/embedded/gems/gems/bundler-1.10.5/lib/bundler/shared_helpers.rb:78:in `split': invalid byte sequence in UTF-8 (ArgumentError)
from /opt/vagrant/embedded/gems/gems/bundler-1.10.5/lib/bundler/shared_helpers.rb:78:in `set_bundle_environment'
from /opt/vagrant/embedded/gems/gems/bundler-1.10.5/lib/bundler/runtime.rb:222:in `setup_environment'
from /opt/vagrant/embedded/gems/gems/bundler-1.10.5/lib/bundler/runtime.rb:15:in `setup'
from /opt/vagrant/embedded/gems/gems/bundler-1.10.5/lib/bundler.rb:129:in `setup'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:71:in `<main>'
and then nothing happens.
Could anybody please tell me what is going on. especially with the - 'split' : invalid byte sequence in UTF-8 (ArgumentError).
I am on Yosemite 10.10.4.

Try changing path to .vagrant.d
export VAGRANT_HOME="..."

Related

New Installation of SilverStripe 4 InjectorNotFoundException

I'm using Vagrant/Homestead/Virtualbox ~ Vagrant version 2.2.10 | Homestead 10.1.1 | Virtualbox 5.2
I'm running the SilverStripe installation on PHP7.4 and my PHP CLI version is also PHP7.4
Following the SilverStripe installation instructions I've ran the following:
composer create-project silverstripe/installer client-folder
When I load up my installation for the first time I get the following error: (I've censored out the client's name)
Weirdly, even though install.php is no longer included with the installed, I got an old install.php file and ran it and the install.php page loaded up perfectly. When I then ran the install script it gave me the error above again.
I've gone through and made sure all the required extensions are installed.
Could anyone advise on how to fix this please?
I've had a look at this. I tried to destroy my vagrant box using the 'vagrant destroy' command but it didn't work.
I ended up opening up the Virtual Box UI and I then destroyed my Vagrant local machine using that interface.
Afterwards, I ran Vagrant Up to create the 'new' box for the 'first time'.
Silverstripe now loads up perfectly well. As a side, Laravel also didn't work and now works.
In short, it was a problem with my local machine and not SilverStripe.

Laravel Dusk: cannot find Chrome binary

I'm following the instructions on how to run browser tests from here https://laravel.com/docs/8.x/dusk on a fresh install of Laravel using Homestead running on a VirtualBox vm.
When I try to run artisan dusk however, it fails and tells me it can't find the Chrome binary.
1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\UnknownErrorException: unknown error: cannot find Chrome binary`
Googling tells me to install the Chrome Binary (of course) but that appears to have been done already. Scrolling up the CLI, I see the following from when I ran dusk install.
Downloading ChromeDriver binaries...
ChromeDriver binaries successfully installed for version 86.0.4240.22.
So is there something else I need to install, or do I need to tell dusk where to look for the binary, or is it something else entirely?
As you already have ChromeDrive you maybe just need to start it
./vendor/laravel/dusk/bin/chromedriver-linux
In order to run laravel dusk you need to have google chrome installed.
That being said if you are using Homestead simply enable the webdriver feature in your Homestead.yaml configuration:
features:
- webdriver: true
Remember that after enabling the webdriver feature, you need to reboot/provison your homestead to load the config change.
vagrant reload --provision
Sources:
https://laravel.com/docs/8.x/homestead#laravel-dusk
https://laravel.com/docs/9.x/homestead#laravel-dusk
You simply need to have chrome installed. That's it. Not chrome dev or canary or any of those alternave versions, you need to have the real chrome browser installed. I had chrome dev installed and I kept getting this error until I downloaded the actual chrome.

Homestead Installed PHP7 but I need PHP5

Homestead randomly stopped working for me, so I tried to remove the whole thing and reinstall, but it's not gone well.
I have it "running" after a day and a half of muddling my way through various issues. However, for reasons that I cannot understand, my Homestead box is now running PHP 7.
The instructions I was following had optional options for installing PHP 7, but I intentionally skipped that because we are on PHP 5.
For the life of me, I can't figure out how to fix this. Things I have tried:
I have destroyed and reinstalled the box multiple times.
I have deleted the VirtualBox box multiple times and redownloaded it.
I tried installing v0.3.3 of the box based on one suggestion. (I also updated the homestead.rb script accordingly.) At one point, something failed during the install process with php7.0-fpm: unrecognized service and the configured sites were returning 502 Bad Gateway errors.
After reinstalling with v.0.4.0, it has started "running" as I described (serves the sites as expected, etc.), but with PHP 7.
Searching for solutions has persistently led to a dead-end.
I'm just a dummy front-end developer. :) Laravel, Vagrant, Homestead, all this stuff makes my head hurt. I just want this to work again so I can go back to my actual work. Any advice or alternate avenues of pursuit for researching this problem would be appreciated.
I've been through this issue too and I solved it by installing an old homestead box v0.3.3 and I've used an old release of homestead installer, so I suggest that you remove your current box v0.4.0 and delete your homestead folder then do this:
$vagrant box add laravel/homestead --box-version 0.3.3
and then download an older version of Homestead installer from git, I'm using v2.1.8 it works fine.
Enjoy php 5.6 :)
I had a similar problem where I tried to upgrade Homestead to the most recent Homestead 7.0 box and configure it to run PHP 5.6 instead of PH7, which various sources said was possible via adding a line to the .yaml file specifying the PHP version.
sites:
- map: myproject.local
to: /home/vagrant/Code/craven/public_html
php: "5.6"
What actually happened when I tried that was that I got a 502 CGI gateway error. Here is a summary of the steps I had to take to fix it:
1) SSH into the Homestead virtual machine.
ssh vagrant#127.0.0.1 -p 2222
Taking a look at the nginx error log in /var/log/nginx/ reveals that the PHP 5.6 files the server is looking for don't exist.
You can get confirmation of this by having a look at the executables.
ls -la /usr/bin/php*
2) To install PHP 5.6, run
sudo apt-get update
sudo apt-get install php5.6-fpm
You can confirm that the php 5.6 service is running via the command
service --status-all
3) Once all this is working, refresh the web page for your site and it should now work. In my case, because I was running a Laravel 4.2 site, I then to install Mcrypt:
sudo apt-get install php5.6-mcrypt
4) In order to get my mysql database up and running, I also had to install mysql.
sudo apt-get install php5.6-mysql
And of course after all that, I had to re-import the database contents from the file I'd exported before upgrading the Homestead box.
Note that if you ever destroy and recreate the Homestead box, you will need to repeat all these steps again.

Why is AMPPS unable to download composer.phar when installing Laravel 5?

Let me start off by saying I'm completely new to Laravel and I would say I'm a beginner at PHP given how long it's been since I last did any PHP development. I'm running Mac OS X Yosemite (10.10.2) and I've installed AMPPS 3.0. I have installed composer and Laravel (as per instructions found here) as well. Now when I try to install Laravel on AMPPS (via http://localhost/ampps) I get the following messages:
The following errors were found :
Could not download composer.phar
Could not install composer
Could someone please enlighten me as to why this is happening? Also is this step necessary since I already have Laravel installed on my mac?
Short answer: I have no idea.
Long answer: I found this link when i was having some trouble with this myself.
Basically what's missing was adding the ampps php path in the bash file.
export AMPPS_PHP=/Applications/AMPPS/php/bin
export PATH="$AMPPS_PHP:$PATH"
Then, moving composer to user/bin directory with
sudo mv composer.phar /usr/local/bin/composer
I just included the big parts of what was missing in my case. Then install laravel as normal.

Why do I get this error while editing the .profile file while installing cakephp on mac?

I'm installing cakephp on mac osx lion on MAMP. And I get the following error when I save the .profile file with the corresponding path.
-bash: export: `=/Applications/MAMP/bin/php5.4.10/bin:/Users/aravind/Sites/cake/lib/Cake/Console:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier
My .profile currently only consists of the following lines. I have no idea what this error means and why it refers to /Library/Frameworks/Python.framework...
alias www="cd /Users/aravind/Sites/public_html"
alias mysql="cd /Applications/MAMP/Library/bin/mysql -uroot -p"
export PATH ="/Applications/MAMP/bin/php5.4.10/bin:/Users/aravind/Sites/cake/lib/Cake/Console:$PATH"
Due to this, I'm not really able to continue with the installation of cakePHP. Help with this please?

Categories