Having a terribly frustrating time not having valet working on a fresh install. Going to any *.test site in my browser just hangs and eventually gets the error message This site can’t be reached, "ping app.test" hangs as well, and eventually errors with "ping: cannot resolve app.test: Unknown host". However pinging a different domain (such as ping.xyz errors immediately, as opposed to after ~20 seconds like with *.test).
On Os Sierra, my composer.json looks like the following
{
"require": {
"laravel/installer": "^1.5",
"laravel/valet": "dev-master"
}
}
Since I've seen that dev-master resolved this for some people. All my processes seem to be running:
However some clues are that http://localhost/ in my browser returns a page 404 - not found, and running sudo nginx returns a bunch of already in user errors:
❯ pwd
/Users/schorr/.valet
schorr#Andrew-Schorr ~/.valet
❯ sudo Nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
and valet fetch-share-url returns
❯ valet fetch-share-url [17:04:53]
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
...
Any help is greatly appreciated. thanks!
Finally figured this out, for anyone else in my very specific situation:
I had changed my user name on the same machine, and for whatever reason installing dnsmasq wasn't overwriting the old /Users/user/.valet/dnsmasq.conf file. So at the very bottom I had:
conf-file=/Users/OLD_USER_NAME/.valet/dnsmasq.conf
conf-file=/Users/NEW_USER_NAME/.valet/dnsmasq.conf
So all I had to do was comment out the OLD_USER_NAME line and was good to go :|
Append http:// to the url the first time you hit it. For example use http://websitedir.test
I hope it's this simple, let me know.
Try the command 'valet paths' and let me know what that spits out.
Related
I am having issues with setting up Laravel Valet on my machine (MacOS Mojave 10.14). I followed the official documentation on Laravel documentation site. I have installed Valet, added Composer to path, I can run valet and laravel commands from anywhere in the system so that works. I have mapped my project folder with valet park. I can also do a ping on any *.test domain and it returns 127.0.0.1 responses.
I have created a new project laravel new blog within that directory and when accessing http://blog.test I am getting nginx 403 forbidden response.
I suspect something may conflict maybe so I tried these steps, none of which worked:
Added explicitly both blog and blog/public to valet link blog and valet link blog2. Accessing blog.test and blog2.test both return forbidden
Killing Apache with sudo apachectl stop returns:
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
sudo killall httpd returns:
No matching processes were found
Uninstalling nginx and running valet install again didn't help.
Running sudo nginx returns:
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] still could not bind()
NOTE: I do have a Docker running on my machine
I have found Docker to be the issue. I already had an app running on port 80 so it was preventing nginx from starting. I shut down the container and run sudo nginx and it solved the issue.
I'm new in lumen and i have done
composer clear-cache then after
composer update
to install some package after configurating composer.json
however i have got this error:
[Composer\Downloader\TransportException]
The "http://packagist.org/p/phpunit/php-timer%24be3efc71adf134c858c1add0117
f060f4ab545fe9d357983c7bea165b2008d65.json" file could not be downloaded: p
hp_network_getaddresses: getaddrinfo failed: Name or service not known
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name o
r service not known
Plase how could i fix this error
This issue was posted about 2 years ago but I wanna answer this problem so
no one should have difficulty like me.
First open /etc/resolv.conf
(if you using Ubuntu distributions, the file is /etc/resolvconf/resolv.conf.d/head)
# cat /etc/resolve.conf
And after that, write this rows to the file:
# Google's public DNS servers
nameserver 8.8.8.8 # Primary DNS server
nameserver 8.8.4.4 # Secondary DNS server
These are the Google's public DNS servers as mentioned in the code above.
Save and close.
After restart the network service using this command:
service network restart
This solved my problem.
Hope help to others...
I fixed the issue on Linux/Centos6 (Plesk Onyx) by:
Opening /etc/resolv.conf (my file was empty)
Added:
nameserver 8.8.8.8
nameserver 8.8.4.4
options rotate
options timeout:3
Hopefully this helps someone out there.
In my case was a dns misconfiguration in Vagrant VM.
Updating DNS in /etc/resolv.conf solved my issue: https://askubuntu.com/questions/897270/dns-cannot-resolve-hosts
hope this will help other users
In case someone in the future needs this...
If you're using docker it's likely you're having DNS issues from inside the container. Basically the fix is :
Find out your network's DNS server :nmcli dev show | grep 'IP4.DNS' (let's say it gives 10.0.0.2)
then update /etc/docker/daemon.json like so :
{
"dns": ["10.0.0.2", "8.8.8.8"]
}
of course replacing 10.0.0.2 with yours. Then don't forget to sudo service docker restart.
I tried using root user and it's working fine.
I was also facing the same error while installing few modules and also composer update.
Tried sudo su to login as root and ran composer command.
I've been using Ampps with no problem until I installed Laravel.
Once I did, Apache in Ampps doesn't start. I suppose it's a conflict on port 80 but I don't know how to solve it.
When I execute:
sudo /Applications/AMPPS/apache/bin/httpd
I get:
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Any ideas?
This was exactly what happened to me and #anexo answer solved the issue.
For some reasons though, the Terminal requires a root access.
Incase anyone have issue with that, just use:
sudo apachectl stop
This would prompt for your password, after which it would complete the operation.
NB: I couldn't add this as comment to #anexo answer due to low rep.
I got it!
When you serve apache through laravel:
php artisan serve
Ctrl + C doesn't kill. You need to kill it through:
apachectl stop
or
/etc/init.d/http stop
Hope someone finds this useful
I have a VPS with CentOS and DirectAdmin installed.
This VPS only have one site with WordPress CMS but Apache have very usage of 1 GB Ram.
for this i buy license and install Danginx plugin.after installing dangnix, my site and IP only show "Welcome to Nginx" text and every other files show 404 error page.
after many Google searchs, everyone says install new ioncube loader but i installed this before Dangnix installation and more than 2 time reinstall.
php -v command also show ioncube loader has installed but my site still show Welcome text.
when i restart apache with service httpd restart command show this error :
NameVirtualHost 79.127.127.143:8888 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
after many edits now this command show only "NameVirtualHost 79.127.127.143:8888 has no VirtualHosts" error.
Sorry for my bad english.
Thanks.
I think your problem is that it is port 8888. If you go to your website, default port is 80. Nginx only shows the message "Welcome to Nginx" if the port is not getting anywhere, so this is a configuration problem in Nginx.
First thing, I could see out there has already solved questions around the problem.
PHP web socket unable to bind socket
Issue in setting the socket server
socket_bind(): unable to bind address [99] (Ubuntu on Amazon EC2)
and many other resources, all of them said that problem is in-used port or external IP,
etc.
But I could not get over it.
My server is running on CentOS 6.3 and using CPanel (it is the HP server https://www.hpcloud.com/).
The web socket demo source code what I get is on https://code.google.com/p/phpwebsocket/
My setting is
$master = WebSocket("127.0.0.1",4444); // even I tried with localhost, they worked same
Here is the step what I tried and the corresponding errors:
1/. I tried following commands to ensure a port which I was using is available to use
$ lsof|grep 4444
$ netstat -a -p -n
But I always got the error although this port 4444 is free
Warning: socket_bind(): unable to bind
address [98]: Address already in use in
/home/myapp/public_html/websocket/server.php on line 60
2/. The strange thing is when I checked the port 835 which was using by
crond 1621 root DEL REG 252,1 39835 /lib64/libpam.so.0.82.2.#prelink#.B1eyGx
atd 1633 root DEL REG 252,1 39835 /lib64/libpam.so.0.82.2.#prelink#.B1eyGx
The funny thing happened:
Then I ran the server.php on my terminal command shell
php /home/myapp/public_html/websocket/server.php
the error has gone, instead of it is
Server Started : 2013-08-16 03:19:54
Master socket : Resource id #4
Listening on : 127.0.0.1 port 835
I thought that it started working, but actually it did not, because when I open server.php by the browser with URL
http://mysite/server.php
The error is "permission denined"
Warning: socket_bind() [function.socket-bind]: unable to bind address
[13]: Permission denied in
/home/myapp/public_html/websocket/server.php on line 60
socket_bind() failed
Edited: About permission, I could open the client.html in same level directory with server.php without problem.
The folder code permission is 755 and user is not root.
All of my commands was implemented under root privilege
Any help is greatly appreciated :(
I would assume that the problem is that you are attempting to load the Websocket server in your webbrowser. Most likely, there are security settings for the apache user that does not allow your server to listen on uncommon ports.
CentOS usually ships with SELinux enabled by default. Part of CentOS Linux's security policies for Apache are that by default, Apache will only allow services access to recognized ports associated with HTTP (ie, port 80, 8080 etc).
With SELinux enabled, you could allow Apache to listen on tcp port 4444 by adding a rule to allow that inside SELinux using the 'semanage' command:
~$ semanage port -a -t http_port_t -p tcp 4444