When using PHP5’s own file_ get_ Content method to get remote files (in my
There are similar call requirements in the automated test framework, and sometimes the file will appear_ get_ Contents(): failed to open stream: http request failed.
The solution is to modify php.ini Let_ url_ Fopen is enabled and changed to allow_ url_ fopen = On
This can solve some people’s problems. Some people say that in China php.ini In, there are two options: allow_ url_ Fopen = on (indicates that the remote file can be opened through URL), user_ Agent = “PHP” (which script is used to access the network. By default, there is a “;” in front of it.) Restart the server.
But some will still have this warning message. If you want to use the perfect solution, you still need to set it php.ini User in it_ Agent, PHP’s default user_ Agent is PHP. We can change it to Mozilla/4.0 (compatible; MSIE 6.0; windows u> NT 5.0) to simulate browser, user_ agent=”Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”
Read More:
- php Error failed to open stream: HTTP request failed!
- failed to open stream: HTTP wrapper does not support writeable connections
- move_uploaded_file() failed to open stream: Permission denied
- An idea to solve Warning move_uploaded_file, failed to open stream in the process of php uploading files
- error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
- IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
- Git solves the problem of failed: http request failed
- PHP error Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error:
- The request failed with HTTP status 401: Unauthorized. SSRS 2008
- Git error: http request failed
- Resolve git clone error fatal: http request failed
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- IIS “Bad Request – Request Too Long. HTTP Error 400. The size of the request headers is too long.”
- [PHP]stream_socket_client(): Failed to enable crypto
- Vue failed to log in. F12 reported an error: request failed with status code 404
- Error analysis of veeam backup: failed to create NFC download stream
- Bad Request – Request Too Long. HTTP Error 400. The size of the request headers is too long
- urlopen error unknown url type:httpë/HTTP Error 400:Bad Request
- Pull the git warehouse code IDEA reports an error: Clone failed: Authentication failed for’http://10.xx.XXXXXXXXXXXXXXXXX’
- Solution to burning problem of esp8266 module based on Arduino_ open failed error: espcomm_ upload_ mem failed