Laravel valet park shows XAMPP main page - php

I am currently learning PHP Laravel. I am in the process of setting up valet. However, I encountered a problem. Whenever I type (filename).dev, it shows the XAMPP main page instead of the Laravel initial project page. Can someone explain why this is happening?

The original answer can be found here.
Remove valet completely (some reason valet uninstall does nothing) so to get the latest version (v1.1.3 at the time)
Stop Apache: apachectl stop
Update Valet: composer global require laravel/valet
Install Valet: valet install
Restart Valet: valet restart
With some others, it might be a good option to try and simply turn-off/stop your locally running Apache, as this as others might find is only the issue that fixes it.

I faced the same issue as I was running Xampp and Valet at the same time on my Windows Machine, try turning off the xampp/apache and run the page again.
Steps to install Valet on Windows..
Install composer from https://getcomposer.org/download/
Then run composer global require cretueusebiu/valet-windows
Then run: "valet install"
Open your Laravel project directory in cmd (administrator mode)
Then run: "valet park"
Then run: "valet link"
Then run: "valet secure" (if you want your website to be secured by TLS)
In the control panel/network and sharing center choose the active connection and in its properties enter 127.0.0.1 in TCP/IPv4 IPv4 settings
In the control panel/network and sharing center choose the active connection and in its properties enter ::1 in TCP/IPv6 IPv6 settings
Then run: "valet start"
Enter the "projectname" followed by ".test" in the browser.
For example: if your project name is demolaravel, then run demolaravel.test in the browser

Related

Curl error thrown for http POST to /session

I installed Laravel Dusk for website testing. I tried every solution on Stackoverflow regarding this problem but nothing worked.
I need to run browser headless because I'm running tests on my Linux server.
Current version of chromedriver-linux is:
./vendor/laravel/dusk/bin/chromedriver-linux --v
ChromeDriver 90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430#{#429})
Current version of Chromium is:
chromium-browser --version --no-sandbox
Chromium 90.0.4430.93 snap
When I run Dusk I get error:
Operation timed out after 30001 milliseconds with 0 bytes received
Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","platformName":"linux","goog:chromeOptions":{"args":["--headless","--disable-gpu","--no-sandbox"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"linux","chromeOptions":{"args":["--headless","--disable-gpu","--no-sandbox"]}}}
Is there any way to resolve this? I tried by adding arguments "--headless","--disable-gpu","--no-sandbox" but unfortunately it is not working.
friend!
I assume you are on Windows host with Homestead (Windows 10, Homestead 10 and Laravel 8). If not, I am not sure this answer will help. But this just helped me, literally, a few minutes ago, so I feel obliged.
Dusk appears not like Chromium and desires a full Chrome. So lets install it:
cd ~
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
This will download the latest stable google chrome and install it.
Do make sure that you got your project's vendor/laravel/dusk/bin/ folder is executable, as the docs suggest. So, in the root of your project:
chmod -R 0755 vendor/laravel/dusk/bin/
Make sure you got the latest chromium-driver installed:
php artisan dusk:chrome-driver --detect
3.1. If it will give you hard time (cannot rename, cannot move files, yada-yada) - it is probably because you have the driver already running, so exit Homestead and just
vagrant reload
return back to homestead and repeat 3 above.
Make sure you are able to curl your APP_URL. Let's say it is laravel.app:
curl http://laravel.app
If not, check /etc/hosts, you expect to see something like 127.0.0.1 laravel.app - following our assumption about the URL. This is normally set by Homestead itself, when you provision a new site.
Voila.
php artisan dusk
was successful.
That fixed it for me.
I have spent exorbitant amount of time which could have been saved by a single line in docs "If you are running Homestead on Windows, make sure to install Google Chrome"
Happy coding!

Laravel valet always asks password

After reinstalling macOS, I started setup my dev environment based on Laracasts "Setup a mac dev machine from scratch". At the previous time when I installed php/valet/composer etc, everything was fine, but now the terminal (in every new session) always asks password when I type valet.
I added the composer path to .zshrc
export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH
In order to get this going you can run the following command:
$ valet trust
This will let you enter the password once, and remember it.
Using the trust command, you indicate that the current machine can be trusted for development, and Valet will stop asking for the password.
Your macOS native apache might be running, try stopping it
sudo apachectl stop
running sudo valet start fixed it for me.

Unable to install Laravel Homestead - UID/Directory issue

I have followed the steps on Laravel's website, to install Homestead, through VirtualBox.
Install Virtual Box (through their package)
Install Vagrant (through their package)
Run vagrant box add laravel/homestead
Within my application's directory, run composer require laravel/homestead --dev
Run php vendor/bin/homestead make
All of the console output shows a success for the above. I can see the Homestead.yml and Vagrantfile files within the app's directory.
When I run vagrant up, I then get this error:
The VirtualBox VM was created with a user that doesn't match the
current user running Vagrant. VirtualBox requires that the same user
be used to manage the VM that was created. Please re-run Vagrant with
that user. This is not a Vagrant issue.
The UID used to create the VM was: ** Your UID is: **
I'm unsure why this has happened, as I haven't used sudo, nor switched between.
Also, within Virtual Box's preference, it shows the default install location of boxes to be in: /Users/AccountName/VirtualBox VMs, but that directory doesn't exist.
However, Vagrant will list laravel/homestead as a box that's installed.
I'm unsure what exactly the problem is.
Please help!
You have to run vagrant up command into ~/Homestead directory.

Issue with running Vagrant in Homestead

I tried setting up a virtual machine using Homestead box. I followed documentation on Laravel site for setting up Homestead.
When I ran the command vagrant up, it seemed to work in setting a VM. Then it asked to run vagrant provision, which I did.
I can't get pass red text 'You are already using composer version 1.1.3 (stable channel)'. I don't know what to do next.
Update: here is Homestead.yaml file:
Needed to edit the file at
~/.homestead/Homestead.yaml
instead of
~/Homestead/Homestead.yaml
after that reload it as usual
vagrant reload --provision
Add
~/.composer/vendor/bin
to Your PATH on host machine (not inside vm).
After restart terminal You can use homestead command.

Installing FFMpeg in Lumen

I am using Lumen (of Laravel) as my backend and using vagrant. I am want to install and use FFmpeg but I got confused how to install it.
Do I need to install it on my localhost or add it to Lumen? or both?
I found this page but I got lost which commands to run.
Update: I installed this repo on Github and run it in vagrant. I think this installed the latest version on my local server, but what should I do next? How can I install and use FFMpeg with Lumen in php?
Go to your Homestead folder, run vagrant ssh. This will get you into your vagrant machine's terminal. Run command sudo apt-get install ffmpeg there and acknowledge the questions you get asked. (Additional libraries for PHP integration might be required.) FFMpeg will be ready to use.

Categories