Pagekite error: FAIL: localhost:8080 is down - php

When i try to create a tunnel to my localhost:8000 with $ pagekite.py 8080 xxxx.pagekite.me, i get a error when someone trys to connect: (FAIL: localhost:8080 is down). I created the server on my local machine with: $ php -S localhost:8080. When i try to access to the site on my local machine with http://localhost:8080, everything works perfectly.

Your webapp is probably listening on IPv6 localhost (::1) and pagekite.py is trying to connect to IPv4 localhost (127.0.0.1).
Forcing your webapp to listen on 127.0.0.1 should fix this.
$ php -S 127.0.0.1:8080

Related

php Webserver on local machine. Pagekite error: FAIL: localhost:8080 is down

When i try to create a tunnel with $enter code here pagekite.py 8080 xxxx.pagekite.me , and someone trys to connect, there is this error: (FAIL: localhost:8080 is down). I created the website on my local machine with $ php -S localhost:8080. When i try to connect to the server on my local machine with http://localhost:8080 the site works perfectly.

An attempt was made to access a socket in a way forbidden by its access permissions in symfony

Hello I'm newbie for symfony frame work.
currently using Symfony version 3.4.
I'm implementing websockets to my project using Gos Web Socket Bundle (https://github.com/GeniusesOfSymfony/WebSocketBundle) and documentation also.
after run this command
`php bin/console gos:websocket:server`
getting message like this.
`Failed to listen on "tcp://127.0.0.1:8080": An attempt was made to access a socket in a way forbidden by its access
permissions.`
in config.yml added this
`# Web Socket Configuration
gos_web_socket:
server:
port: 8080 #The port the socket server will listen on
host: 127.0.0.1 #The host ip to bind to`
If I changed port no 8080 to 80 I will get any error from command prompt but in browser it doesn't work. If I used 8080 websocket server is not running. Help me out! spent whole full day on this.
Without being a root (or via sudo) you are not allowed to listen to privileged ports (<1024).
As for the port 8080 check if there is another service already running on it:
lsof -i :8080
Have you tried selecting another port, for example, 8888?
Hope this helps...

Google cloud shell problem with PHP built in server - could not connect to Cloud Shell on port 8080

I can't get to work my simple index.php file on Google cloud shell. I start my server with command php -S localhost:8080 -t test/. Before that I navigate just before test folder. I click Web preview in upper right corner and get error: Could not connect to Cloud Shell on port 8080 What could be the problem?
After hours of working, and reseting... I just change from php -S localhost:8080 -t test/ to php -S 127.0.0.1:8080 -t test
In Cloud Shell localhost resolves to both IPv4 and IPv6 addresses:
$ head -3 /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
It appears that when this is the case, PHP's builtin web server only binds to the IPv6 address; however, Cloud Shell web preview connects to the IPv4 addresses. Your solution to bind directly to the IPv4 loopback interface (127.0.0.1) is probably the best, for now.

Telnet connection on localhost Refused

EDIT:
I want to telnet into my web server on localhost, and request my php file from command line:
I have:
1) cd'd into the directory I want to serve, namely "/www" (hello.php is here)
2) run a server at directory www: python -m SimpleHTTPServer
3) telnet localhost 80
but "connection is refused". what am I doing wrong?
You're probably trying to connect to a wrong port. Check with netstat -lntp which port is your http server listening on. The process will be listed as python/pid_number.
If you're using Linux then try this:
$ telnet localhost 80
GET /hello.php

How to enable PHP's built-in web server on wercker

I have setup my wercker.yml file with the following step midway:
- script:
name: Serve application
code: php -S localhost:8000 >> /dev/null &
That appears to run, however, in another step when I try cURL to http://localhost:8000 I get the following:
curl: (7) Failed to connect to localhost port 8000: Connection refused
It does it for all ports, not just 8000. Has anyone else managed to get PHP's in built server working in wercker, or open any ports?
Assuming you're using the wercker CLI and trying to set up a development pipeline, you need to use wercker dev with the --publish 8000 argument. This will forward the traffic from your host on port 8000 to the container on port 8000.
Also, if you're using boot2docker, you can't specify localhost, since boot2docker spins up a VM that runs docker. In that case you'll need to use your boot2docker IP, which you can find by running the boot2docker ip command.

Categories