Create a test. php {code ...} then access test. php, the error is as follows: Warning: file_get_contents (test1.xiaoci. comcreate. php) [function. file-get-contents]: failedtoopenstream: HTTPrequestfailed! H...
Create a test. php
Access test. php and the result is as follows:
Warning: file_get_contents (http://test1.xiaoci.com/create.php) [function. file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in J: \ wamp \ www \ long \ wwwroot \ mytools \ test \ test1.php on line 3
Note:http://test1.xiaoci.com
It is a virtual host I set up locally.
The configuration of a local virtual host is as follows:
Http-vhost.conf
DocumentRoot "d:/wamp/www/" ServerName test1.xiaoci.com
Hosts
127.0.0.1 test1.com127.0.0.1 test1.xiaoci.com
If 404 is set to return to index. phphttp://test1.xiaoci.com/create.php
Because create. php does not exist in the URL, it will be forwarded to index. php and processed in index. php.
Manual open ("http://test1.xiaoci.com/create.php") condition: normal access
Usefile_get_contents("http://test1.xiaoci.com/create.php")
: Error 404 is reported.
Reply content:
Create a test. php
Access test. php and the result is as follows:
Warning: file_get_contents (http://test1.xiaoci.com/create.php) [function. file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in J: \ wamp \ www \ long \ wwwroot \ mytools \ test \ test1.php on line 3
Note:http://test1.xiaoci.com
It is a virtual host I set up locally.
The configuration of a local virtual host is as follows:
Http-vhost.conf
DocumentRoot "d:/wamp/www/" ServerName test1.xiaoci.com
Hosts
127.0.0.1 test1.com127.0.0.1 test1.xiaoci.com
If 404 is set to return to index. phphttp://test1.xiaoci.com/create.php
Because create. php does not exist in the URL, it will be forwarded to index. php and processed in index. php.
Manual open ("http://test1.xiaoci.com/create.php") condition: normal access
Usefile_get_contents("http://test1.xiaoci.com/create.php")
: Error 404 is reported.
Shouldn't the host be
127.0.0.1 test1.Xiaoci.Com
Why? I saw that the Internet site is indeed 404. In the visual test, you pushed it to the Internet, and the host didn't cover it.