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ể.


5 Responses to “PHP 5 Unable to Open HTTP Request Stream with fopen or fsockopen Functions” 5 hồi đáp tới "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"

  1. Tarandeep Tarandeep
    March 28th, 2009 00:40 Tháng ba 28, 2009 00:40
    5 5

    It did not work for me… Nó đã không làm việc cho tôi ...

  2. Vladimir Vladimir
    February 25th, 2009 15:05 25 tháng hai, 2009 15:05
    4 4

    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 đỡ

  3. Rob Rob
    November 30th, 2008 03:22 30 tháng mười một, 2008 03:22
    3 3

    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 :)

  4. Module Mô-đun
    November 14th, 2008 20:51 14 tháng mười một, 2008 20:51
    2 2

    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

  5. totoro totoro
    October 6th, 2008 05:33 6 tháng mười, 2008 05:33
    1 1

    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

Leave a Reply Để lại một trả lời

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Bạn có thể sử dụng các thẻ:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Đăng ký nhận xét tính năng đã bị vô hiệu hoá. To receive notification of latest comments posted, subscribe to Để nhận được thông báo về ý kiến mới nhất được đăng, đăng ký với My Digital Life Comments RSS feed Cuộc sống kỹ thuật số Bình luận của tôi nguồn cấp dữ liệu RSS or hoặc register to receive đăng ký để nhận được new comments in daily email digest. Các ý kiến mới trong thư điện tử tiêu hàng ngày.
Custom Search

New Articles Bài viết mới

Incoming Search Terms for the Article Tìm kiếm các điều khoản cho các Điều

failed to open stream: HTTP request failed! failed to open stream: HTTP yêu cầu không thành công! - -- failed to open stream: HTTP request failed failed to open stream: HTTP yêu cầu không thành công - -- file_get_contents failed to open stream file_get_contents failed to open stream - -- fsockopen php.ini fsockopen php.ini - -- enable fsockopen cho phép fsockopen - -- php http request php http yêu cầu - -- failed to open stream: HTTP request failed! failed to open stream: HTTP yêu cầu không thành công! - -- php enable fsockopen php cho phép fsockopen - -- fsockopen php ini fsockopen php này - -- file_get_contents php.ini file_get_contents php.ini - -- fsockopen enable fsockopen bật - -- 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! - -- enable fsockopen php cho phép fsockopen php - -- php.ini fsockopen php.ini fsockopen - -- php5 fsockopen php5 fsockopen - -- fsockopen php5 fsockopen php5 - -- fopen HTTP request failed fopen HTTP yêu cầu không thành công - -- enable file_get_contents cho phép file_get_contents - -- HOW TO ENABLE FSOCKOPEN Cách kích hoạt FSOCKOPEN - -- fopen php.ini fopen php.ini - -- enable fopen cho phép fopen - -- php open stream php mở dòng - -- apache fsockopen apache fsockopen - -- php httprequest php httprequest - -- "failed to open stream: HTTP request failed!" "failed to open stream: HTTP yêu cầu không thành công!" - -- php fsockopen https php fsockopen https - -- file_get_contents HTTP request failed file_get_contents HTTP yêu cầu không thành công - -- php fsockopen http php fsockopen http - -- php open http stream php mở http dòng - -- enable fsockopen php.ini cho phép fsockopen php.ini - -- fopen failed to open stream: HTTP request failed! fopen failed to open stream: HTTP yêu cầu không thành công! - -- failed to open stream HTTP request failed failed to open stream HTTP yêu cầu không thành công - -- php.ini fopen php.ini fopen - -- php ini fopen php này fopen - -- fsockopen apache fsockopen apache - -- fopen php5 fopen php5 - -- user_agent php.ini user_agent php.ini - -- open stream php mở dòng php - -- enable fsockopen() cho phép fsockopen () - -- allow_url_fopen fsockopen allow_url_fopen fsockopen - -- failed to open stream: HTTP request failed failed to open stream: HTTP yêu cầu không thành công - -- php.ini user_agent php.ini user_agent - -- php HTTP request failed php HTTP yêu cầu không thành công - -- 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 file_get_contents - -- php file_get_contents HTTP request failed php file_get_contents HTTP yêu cầu không thành công - -- fsockopen php enable fsockopen php cho phép - -- php http request fopen php http yêu cầu fopen - -- fopen php 5 fopen php 5 - -- fsockopen() in php fsockopen () trong php - -- php fsockopen windows php fsockopen cửa sổ - -- php5 HttpRequest php5 HttpRequest - -- 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 open http request php mở http yêu cầu - -- php5 http request php5 http yêu cầu - -- php fopen http php fopen http - -- fsockopen php 5 fsockopen php 5 - -- fopen cannot connect to urls (PHP parameter allow_url_fopen is set to Off) fopen không thể kết nối đến các url (PHP allow_url_fopen tham số được thiết lập để Tàõt) - -- php file_get_contents failed to open stream: HTTP request failed! php file_get_contents failed to open stream: HTTP yêu cầu không thành công! - -- php fopen failed to open stream http request failed php fopen failed to open stream http yêu cầu không thành công - -- php allow fsockopen php cho phép fsockopen - -- 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!" - -- fsockopen in php fsockopen trong php - -- fsockopen() enable fsockopen () cho phép - -- http request stream http yêu cầu dòng - -- php disable fsockopen php tắt fsockopen - -- php stream open php dòng mở - -- failed to open stream: HTTP request failed! failed to open stream: HTTP yêu cầu không thành công! HTTP HTTP - -- file_get_contents failed to open stream file_get_contents failed to open stream - -- php http stream php http dòng - -- failed to open stream: HTTP request failed! failed to open stream: HTTP yêu cầu không thành công! - -- php5 fopen php5 fopen - -- 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 fsockopen php.ini php fsockopen php.ini - -- php.ini file_get_contents php.ini file_get_contents - -- HttpRequest php5 HttpRequest php5 - --