Cannot access php built-in web server from outside

Asked 1 years ago, Updated 1 years ago, 69 views

Currently, using php framework slim on mac,
We are trying to develop a site that is a built-in web server.

You can access the site from a Mac browser.
I can't do it from my iPhone.
Two weeks ago, it was done in the same way. I didn't mess with him for two weeks, but he looked like this.

php-S 0.0.0.0:8080

192.168.11.3

You can view the site normally

"I cannot open the page.Safari could not connect to the server.
Then, an error of ↓ appears in the terminal where the server is started.
[Sat Jun 6 21:15:11 2015] 192.168.11.1:3424 Invalid request (Unexpected EOF)

By the way, even if you access the same URL from another PC on the same network,
As expected, I cannot access it and get the same error as ↑.

I have confirmed that the iPhone and PC are connected to the same network.

Previously
I didn't know how to do this in the first place. I was able to find out how to access it from the outside, but
I tried the same method for the first time in about two weeks, but I couldn't access it.

Please let me know if there is anything else wrong with the settings or if there is a reason.

php slim

2022-09-30 20:48

2 Answers

When the terminal says Invalid request (Unexpected EOF), I feel like I'm getting access to a built-in server.

In order to isolate the problem, why don't you first create a directory that has nothing to do with the slim and put index.php that only echoes?If echo appears, the problem may be with the slim side configuration or implementation.

index.php

<?php    
echo "Hello, World";


2022-09-30 20:48

How about Apache or nginx?

There is another way to use the tunnel service ngrok.I was able to confirm the operation in my environment.Here's how to do it with ngrok:

Install the command tool ngrok first so that it can run from the command line.

Next, create an account for ngrok.Oauth authentication with Github and Google accounts is available.

Now run the following command with the authentication token displayed on the dashboard page of ngrok as an argument:The code is displayed for copying.

./ngrok authtoken authentication token

Finally, run the http subcommand to expose the server.The argument specifies the port number.

./ngrok http8080

You will see a URL to the right of 」Forwarding の, so make sure that the page appears by accessing it in your browser.


2022-09-30 20:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.