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

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 :)

Related

After install OJS 3.X i cant acess the installation via Localhost

I have a problem, I installed OJS using Xampp, the installation went smoothly, but when accessing localhost/ojs I am receiving the error 500, in the index of my Xampp there is the following sentence:
Something is wrong with the XAMPP installation :-(
I don't know where to start, I've tried renaming index.php to index.txt with no results.
Thank you for your attention.
Tried to rename index.php
Tried reinstall ojs on another xampp database
localhost/phpmyadmin works fine.

phpmyadmin Error : PHP 7.1.3+ is required. Currently installed version is: 7.0.27

Using Moc OS
I was using XAMPP 7.0.27 and
Now updated to XAMPP 7.2.28
After Upgrading not able to open PhpMyAdmin Page using
http://localhost/phpmyadmin/
Getting Following Error on Page
PHP 7.1.3+ is required.
Currently installed version is: 7.0.27
What Should be done to open phpMyAdmin ?
It seems something didn't get upgraded properly or there's a conflict, because XAMPP 7.2.28 should come with PHP version 7.2.28.
Have you some other PHP installation, perhaps you at one time tried to install your own PHP outside of XAMPP? I suggest removing any other installations to as to avoid conflicts. Your MacOS probably comes with PHP, which could be the conflict.
You could start with the XAMPP control panel to verify which is installed, which PHP is being used by XAMPP, and checking that everything is working together. The installer should have put all the pieces in the right places, so if after all that it still isn't working, I suggest reinstalling XAMPP.

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.

Moving/migrating application from Homestead to Valet

I have a Laravel application running on Homestead. I'm trying to migrate this to using valet instead.
What I have done.
Removed the IP from the hosts file
Removed the pointer in the homstead.yaml
Ran vagrant reload --provision
Ran valet restart
Still, valet does not seem to do the correct routing. It does not serve the directory.
Anyone know why?
This issue was solved by restarting my computer.

Laravel Valet - This Site Can't Be Reached

I have successfully followed the Setup a Mac Dev Machine until this tutorial: https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch/episodes/10?autoplay=true
The problem is that when I go to SITENAME.dev, nothing shows up. Instead, I get the following message:
This site can’t be reached
test2.dev refused to connect. Did you mean http://test2.de/? Search Google for test2 dev ERR_CONNECTION_REFUSED
I've tried this both for a laravel install (using the laravel installer) and a wordpress install. Neither one works.
Any idea why it is not working. I have followed the course step-by-step as well as the comments. For instance, I modified the .zshrc file as follows based on the course and comments:
export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH
And, in case it is relevant, I am on Mac Sierra (freshly updated).
In short, where Jeffrey is able to get a home page of laravel, I get an error.
Any idea how to fix this?
Thanks.
Go to your site folder and execute the following commands:
cd your_project
composer global update
valet uninstall
rm -rf ~/.valet
rm -rf ~/.config/valet
valet install
valet link
valet open
It fixed this issue for me, and particularly after PHP upgrades.
Mac os mojave - version 10.14,
cd in your-project-folder-name and run
valet secure your-project-folder-name
Solution:
composer global update
brew upgrade nginx
cd your_project
valet start
For more details read this blog
https://medium.com/#panjeh/valet-this-site-cant-be-reached-err-connection-refused-ad424ea1e343
Have you actually started the valet service? Head over to the directory that you ran
$valet park
in, I'm assuming it's where you've also placed your project and type:
$valet start
into the terminal. That works for me.
Be sure you're over http://app.test and not https://app.test
Laravel Valet uses Not secure http as default.
By the way if you want to secure your app then use
valet secure YOURAPPNAME
Deleting the file (sudo rm /etc/resolver/dev) will clear this issue up.
IF valet is trying to open a HTTPS (SSL connection) type command line in your terminal
valet secure

Resources