Getting 500 error using vmware and bitbucket repo - laravel

I went from using homestead to using vmware with ubuntu installed and now when I grab my site from my bitbucket repo it doesn't want to work. I get a 500 error, but if I install a brand new laravel app it works fine. I'm not sure how to fix this or what to add here to help

Related

Laravel Homestead is stuck at running npm install

I've installed Laravel Homestead recently, but when I try to run npm install it gets stuck at building the babel package.
Line where it get's stuck: build:#babel/helper-validator-option: sill linkStuff #babel/helper-validator-option#7.12.11 has /home/vagrant/code/testsite/node_modules as its parent node_modules
Installing a single package like VueJS works fine.
I'm using NFS on Windows right now for syncing the folders.
Versions:
Vagrant: 2.2.14
Homestead: 10.1.1
Windows 10
Kind Regards,
Corné
If you are using your Office wifi. Your office Network is blocking your proxy. That is why you are stuck.
Switch to another Wifi and maybe connect your VPN(if you are doing it on your office computer)

Why does Dusk show error "This site can't be reached" ERR_CONNECTION_REFUSED after my Homestead upgrade?

I've enjoyed Laravel, Homestead, and Dusk for years. Everything was working fine, but I recently needed to upgrade to PHP 7.4 for a new package I wanted to install, so I went ahead and upgraded VirtualBox, Vagrant, etc to:
vboxmanage --version = 6.1.2r135662
Vagrant 2.2.7
laravel/homestead (virtualbox, 9.2.0)
Homestead v10.2.0
Laravel 6.13.1
Dusk v5.9.0
Ubuntu 18.04.3 LTS
PHP 7.4.1
Windows 10 is the host
Now, when I run my Dusk browser tests, they produce screenshots with this error in Chrome: "This site can't be reached" ERR_CONNECTION_REFUSED
But in Windows Chrome, I can browse to my local site fine, as usual (Windows is the host of my Homestead box).
My APP_URL in .env is (and has always been) APP_URL=https://abc.192.168.1.105.xip.io:44300, and it's the same in my .env.dusk.local file, which I've always had.
In Vagrant, when I run wget https://abc.192.168.1.105.xip.io:44300, the result says failed: Connection refused. But if I run wget 127.0.0.1, it downloads the correct page.
So then I figured I could change my APP_URL to 127.0.0.1 (although I wouldn't know why my upgrades would lead me to be required to make that change).
However, then the error in the Dusk Chrome screenshot becomes "Your connection is not private" NET::ERR_CERT_AUTHORITY_INVALID.
I have not found the docs at https://laravel.com/docs/6.x/dusk#installation to help with these problems. Ideas?
P.S. If I change to APP_URL=https://google.com, the screenshot successfully shows Google. So at least Chrome is installed properly in Homestead.
I got it working. I don't understand why these steps seem to be necessary since they were never necessary in my prior experience using Dusk, and no documentation mentioned them as newly necessary due to recent upgrades.
I removed ":44300", so now my .env.dusk.local says APP_URL=https://abc.192.168.1.105.xip.io
Then, running Dusk led to the "Your connection is not private" NET::ERR_CERT_AUTHORITY_INVALID error again, so I figured I needed to tell the Homestead Chrome browser to trust the self-signed certificate. https://stackoverflow.com/a/49612084/470749 and https://stackoverflow.com/a/22813705/470749 led me to run:
sudo apt-get install libnss3-tools
vagrant#vboxHomestead:~/Code/myproject$ cat /etc/nginx/ssl/ca.homestead.vboxHomestead.crt > ca.homestead.vboxHomestead.crt
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "ca.homestead.vboxHomestead.crt" -i ca.homestead.vboxHomestead.crt
Now Dusk runs again.

Should I use homestead for an exact Laravel replication?

My client is running Laravel 5.2 and PHP version 5.6 (all obviously several years old).
I tried to clone the git into Valet with relative success in that the application ran but a bunch of pages threw errors which I am certain is due to me running the latest version of PHP.
So, my question is it better to directly clone the project on Homestead?
Does Homestead offer a more "native environment" for a situation like I am in?
you should try to use an environment that is the closest possible to production.
If your customer uses apache, try xampp. Else adapt to his environment and PHP version, so you can concentrate on code production instead of keep the solution working on more than one environment.
One year later, I came across with the exact same problem; php 5.6.31 and Laravel 5.2.
I managed to simulate the environment with homestead 6, following these steps:
copy the project files to a new folder
Unzip php 5.6 to my local pc (remove php7)
run: composer update (must run with php 5.6 on local pc)
run: composer require laravel/homestead:~6.6.0
run: vendor\\bin\\homestead make
edit Homestead.yml as needed (.ssh path, add php: "5.6" one line below the site sync)
run: vagrant up
run: vagrant ssh
make appropriate changes (google them) according to problems faced on homestead.test (edit xdebug for 502 BAD GATEWAY, edit my.cnf for adding utf8, etc)

404 - Not Found when I try to browse to my local WebServer using the IP

So I'm developing responsive websites and obviously need to test these via phones and tablets and it used to work fine, up until yesterday, after I tried installing js frameworks like npm.
For some reason, when I browse to my local testing using the ip it get:
404 - Not Found
I've been used to using:
http://192.168.0.2/filename.php
I've tried:
http://192.168.0.2:8080/filename.php
...still get 404 - Not Found
I've restarted Apache and checked the the port is correct, and it is.
Listen 80
This happened before when I installed Laravel and Valet, but not long after that I had to wipe my Mac due to work and it started working again with a fresh install.
Am I missing something in Apache? does npm and Laravel mess with the Apache settings?
Locally, everything works fine. I can browse to localhost/filename.php directly using Mac with PHP and MySQL talking to each other, albeit after using Homebrew to install MySQL, PHP connections now only accepts 127.0.0.1 rather than localhost.
I've set all the permissions to "everyone" there should be no access issues.
I've noticed another oddity with Firefox Dev Ed too. When I've been using Valet or Gulp, it stops connecting and give a Cannt connect to server error, but Safari and Chrome seem to work ok.
If anyone can shed some light on this, I'd be happy to give it a go!
All fixed! It was Larvel's Valet installation that was causing the issue, as suspected.
So, looked at the brew Cellar directory in /usr/local/Cellar, but it wasn't actually in there. Then opened up Terminal and typed:
valet install
Then ran valet by typing:
valet
Then uninstalled valet by typing:
uninstalled valet
Then restarted Apache2 by typing:
sudo apachectl restart
adding password
Booted up the browser and browsed to localhost/info.php which holds the line <?php phpinfo() ?> and HAPPY DAYS :)

Laravel installed but confusion remains

I have ubuntu 14.04 and LAMPP is installed. I was learning Laravel 4, but get a lot of confusion on it's documentation, below I list few of issue.
How to install laravel?
what I did :
copy github repository into /opt/lampp/htdocs/larva and run composer install, Laravel is installed and I can access it with http://localhost/larva
What is homestead? is that another way to install laravel or this is additional thing?
What is artisan? if I use artisan then do we need to use homestead also?
what I did ( in terminal )
cd /opt/lampp/htdocs/larva
php artisan serve
it started the service and I can access laravel with htpp://localhost:8000 BUT if i close this terminal then URL is lost
and there is one other way is using vagrant? do we need to use vagrant if we installed it already?
one more thing is Nginx?
overall these vagrant, Nginx, Homestead, artisan,and composer methods create such a mess.
Please clear the clouds and please do not mention what is vagrant Nginx and all. I just want to know that do I need to do something with Homestead and vagrant if i have installed using git repository and composer way?
Thanks
Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine.
Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application. It is driven by the powerful Symfony Console component.
When you close the terminal, you are stopping the service on port 8000. You always can create a virtual host, and point its root to your larval installation /public directory
you dont have to use vagrant to run laravel. Vagrant is just your 'bridge' to Virtual Mashine.
If you installed LAravel via composer and you got it work on localhost:8000 then you dont need neither homestead or vagrant

Resources