PHP 5 Unable to Open HTTP Request Stream with fopen or fsockopen Functions PHP 5 Không thể Đã giải quyết Yêu cầu HTTP Stream với fopen hoặc fsockopen Chức năng
With Apache/2.xx or Apache/2.2.x webserver, with PHP5 as the scripting module, a HTTP communication error may occur within the PHP scripts that are parsing and running via the web server. Với Apache/2.xx hoặc Apache/2.2.x web, với PHP5 như là mô-đun scripting, một HTTP thông báo lỗi có thể xảy ra trong PHP script được phân tích cú pháp và các hoạt động thông qua máy chủ trang web.
The errors that generated by PHP include: Các lỗi mà được tạo ra bởi PHP bao gồm:
PHP Warning: fopen(http://www.example.com): failed to open stream: HTTP request failed! PHP Warning: fopen (http://www.example.com): failed to open stream: HTTP yêu cầu không thành công!
fsockopen(): unable to connect to … fsockopen (): không thể kết nối vào ...
file_get_contents(): failed to open stream: HTTP request failed! file_get_contents (): failed to open stream: HTTP yêu cầu không thành công!
PHP Warning: main(): Failed opening 'http://www.example.com/index.html' for inclusion … PHP Warning: main (): Không thể mở 'http://www.example.com/index.html' để đưa ...
PHP Warning: include(/usr/local/index.php): failed to open stream: No such file or directory in … PHP Warning: include (/ usr / local / index.php): failed to open stream: Không có các tập tin hoặc thư mục trong ...
To resolve the problem, ensure that allow_url_fopen is enabled in PHP.INI configuration file. Để giải quyết được vấn đề, đảm bảo rằng allow_url_fopen được kích hoạt trong PHP.INI tập tin cấu hình. The line should look like this: Các dòng nên hình như:
allow_url_fopen = On allow_url_fopen = On
Note: Depending on your system OS and configuration, the PHP.INI is located at various varied location, such as in Apache bin directory for Windows system or /usr/local/etc in FreeBSD Apache installation, if you don't specify or point to PHP.INI in another directory. Lưu ý: Tùy thuộc vào hệ thống của bạn và cấu hình hệ điều hành, các PHP.INI tọa lạc tại vị trí đa dạng khác nhau, chẳng hạn như trong thư mục Apache thùng cho Windows hoặc các hệ thống / usr / local / etc trong FreeBSD cài đặt Apache, nếu bạn không chỉ định hoặc các điểm PHP.INI vào trong một thư mục.
If the error still happen and the PHP scripts still unable to connect to remote external servers and thus unable to download updates or retrieve files, check the user_agent setting in PHP.ini. Nếu lỗi vẫn xảy ra và các script PHP vẫn không thể kết nối với máy chủ từ xa bên ngoài và vì vậy không thể tải về bản cập nhật hoặc lấy các tập tin, hãy kiểm tra các thiết lập user_agent trong PHP.ini.
By default php.ini set the user_agent to “PHP” which signifies that it's the script that try to access the web server. Theo mặc định, php.ini đặt user_agent đến "PHP" mà biểu rằng đó là chữ viết mà cố gắng truy cập vào máy chủ trang web. Some web servers will refuse and don't allow script to access and receive the date from the server. Một số trang web máy chủ sẽ từ chối và không cho phép tập lệnh truy cập và nhận được các ngày từ server. So, by setting the user_agent to that of a web browser, PHP will let the web server know which kind of web browser will receive the date, and thus able to open the HTTP connection stream. Do đó, bằng cách đặt các user_agent đó của một trình duyệt web, PHP sẽ cho phép các máy chủ trang web biết kiểu trình duyệt web sẽ nhận được trong ngày, và do đó có thể mở các kết nối HTTP dòng.
The user_agent can be set to any kind of browser strings, for example of Internet Explorer: Các user_agent có thể được đặt để bất kỳ loại trình duyệt strings, ví dụ của Internet Explorer:
user_agent=”Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)” user_agent = "Mozilla/4.0 (compatible; MSIE 6,0; Windows NT 5.0)"
IMPORTANT : The page is machine translated and provided "as is" without warranty. Lưu ý: Các trang web là máy tính dịch và cung cấp "như là" mà không có bảo hành. Machine translation may be difficult to understand. Máy dịch thuật có thể là khó hiểu. Please refer to Xin vui lòng tham khảo original English article Tiếng Anh bản gốc bài viết whenever possible. bất cứ khi nào có thể.
Related Articles Bài viết liên quan
- Request URL /server-status or 404 Page Not Found Apache Error Yêu cầu URL / hoặc tình trạng máy chủ-404 Không tìm thấy trang Apache Lỗi
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files Không thể bắt đầu Apache HTTPD Do Đã giải quyết hoặc có thể không phải như vậy Không có mod_bwlimited, mod_log_bytes hoặc mod_bandwidth tập tin
- FreeBSD Apache HTTP Accept Filter Error FreeBSD Apache HTTP Chấp nhận Lọc Lỗi
- Unable to Open Hard or USB Flash Drive with Windows Script Host Cannot Find Script File autorun.vbs Error Đã giải quyết không thể cứng hoặc USB Flash Drive cùng với Windows Script Máy chủ có thể không Tim Script tệp autorun.vbs Lỗi
- cPanel Unable or Cannot Start or Restart POP3 Mail Service cPanel Không thể hoặc có thể không được Bắt đầu hoặc Khởi động lại dịch vụ POP3 Thư
- Aerielle Launches New i2i Stream Wireless Music-Sharing Device Aerielle Launches không dây mới i2i Stream Âm nhạc-Chia sẻ thiết bị
- Unable to Retrieve Channels Listing from TVants Servers Không thể Taíi Kênh Danh sách từ TVants Máy chủ
- Access and Stream Your Videos, Musics, Photos, TV and Other Medias Remotely with Orb Truy cập và Stream Video của bạn, Âm nhạc, hình ảnh, TV và Medias khác xa với orb
- How to Set VLC Player as Media Server to Stream Media Files in Digital Home Làm thế nào để Đặt VLC Player như Stream Media Server để truyền thông kỹ thuật số tập tin trong Trang chủ
- Unable to Connect to Internet in Virtual PC with NAT Shared Networking NAT on Windows XP Guest Không thể kết nối Internet trong ảo với máy PC trong mạng chia sẻ NAT NAT trên Windows XP của Khách










































March 28th, 2009 00:40 Tháng ba 28, 2009 00:40
It did not work for me… Nó đã không làm việc cho tôi ...
February 25th, 2009 15:05 25 tháng hai, 2009 15:05
Thank you a lot for info. Cảm ơn bạn rất nhiều cho các thông tin.
Things with Những điều có
user_agent=”Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)” user_agent = "Mozilla/4.0 (compatible; MSIE 6,0; Windows NT 5.0)"
helped giúp đỡ
November 30th, 2008 03:22 30 tháng mười một, 2008 03:22
I solved the problem too. Tôi giải quyết được vấn đề quá. Default parameter on Sme Server 7.3 allow_url_fopen = Off .. Mặc định tham số trên SME Server 7,3 allow_url_fopen = Off .. Thank you Cảm ơn bạn
November 14th, 2008 20:51 14 tháng mười một, 2008 20:51
Or you can use curl as described here: Hoặc bạn có thể sử dụng curl như mô tả ở đây: http://toic.org/2008/10/08/fetching-remote-content-with-curl/#more-52 http://toic.org/2008/10/08/fetching-remote-content-with-curl/ # thêm-52
October 6th, 2008 05:33 6 tháng mười, 2008 05:33
thank you, I solved my problem. cảm ơn bạn, tôi giải quyết vấn đề của tôi.
by default, on openbsd allow_url_fopen = off theo mặc định, trên OpenBSD allow_url_fopen = off