Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7806995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:42:46+00:00 2026-06-02T02:42:46+00:00

I am experiencing an intermittent issue with the fpassthru function, where I am being

  • 0

I am experiencing an intermittent issue with the fpassthru function, where I am being given the following error which is causing me to have to exit out the script. This is the error I am getting:

Warning:
fopen(http://www.devcrm.lan/rw/category/?session_id=29cc6ecc068bcc1a3862cadb8b9d09c5&admin_sess_id=&g_id=W&cat_id=226&d_id=0&pdid=0&sale=0&page=0&position=&slug=womens/sale/&ajax=0&view_all=0&all=0&c_code=RW&u_region=RW&c_id=1&filter_cat_id%5B%5D=&filter_size%5B%5D=&filter_colour%5B%5D=&filter_price%5B%5D=&HTTP_USER_AGENT=Mozilla%2F5.0+%28Windows+NT+6.1%3B+WOW64%3B+rv%3A10.0.2%29+Gecko%2F20100101+Firefox%2F10.0.2&user_http_host=www.devcrm.lan&user_mobile_config=0)
[function.fopen]: failed to open stream: HTTP request failed! in
/var/www/vhosts/dev/devcrm/shop/index.php on line 213

This is the area of my code where I am using fpassthru. Unfortunately, I am forced to use this function (at the moment, anyway) due to legacy code issues. It is used to send through maintain the $url_parameters when moving from page to page.

    $options = array(
        'http' => array(
            'max_redirects' => 5,          
            'timeout'       => 1,
        )
    );
    $context = stream_context_create($options);

    $fpthruPath = URL . "category/" . $url_parameters;

    $fp = fopen($fpthruPath, 'rb', false, $context);
    if ( false !== $fp ) {
        fpassthru($fp);
        fclose($fp);
    }
    exit();

The strange thing about this is that if I take the URL that I am inserting into fopen and stick it in the browser – it works! Also, it only seems to throw this error the first time I go to the page. Is this an Apache setting issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:42:48+00:00Added an answer on June 2, 2026 at 2:42 am

    OK, after at least a couple of weeks of head-scratching I have found that the ‘timeout’ HTTP setting I am passing into stream_context_create is causing the fopen to fail. When I comment this out I no longer get the failed to open stream: HTTP request failed! warning from fopen.

    I am not sure, however, why this has become a problem since upgrading to 5.3.10 as this was never an issue when using 5.1.6. I have had a look around for some 5.3 performance posts, but can’t find much. Understandably, I have grave concerns over releasing this to a live environment as if something that works in 5.1.6 now struggles, presumably due to the limited timeout, in 5.3.10 then are there performance issues with the newer version of PHP that aren’t documented? There have been no other coding changes between the script that fails (intermittently) on 5.3.10, but always works on 5.1.6.

    I’m not sure whether to remove the timeout or just increase it to 5 or something like that.

    $options = array(
                'http' => array(
                    'max_redirects' => 5          // stop after 5 redirects
                     // 'timeout'       => 1,         // timeout of 1 second
                )
            );
    $context = stream_context_create($options);
    
    $fp = fopen($fpthruPath, 'rb', false, $context);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been experiencing an intermittent issue in my Rails app, and I'm having
I am suddenly experiencing an intermittent error using the Google Checkout ASP.NET control GCheckout.
I am experiencing a very strange issue. I have developped an application locally and
I'm experiencing a really weird issue which I do not know how to solve.
I'm experiencing an intermittent deadlock situation with following (simplified) code. DataSet my_dataset = new
I'm experiencing this intermittent issue where my client is receiving multiple JSON responses from
I'm currently experiencing the following exception when my spring application starts: 2012-04-27 17:42:51,021 ERROR
I'm experiencing two intermittent problems with Silverlight 3.0, running on Windows 7 with Visual
Im experiencing a strange situation which i was supposed to handle. The situation is:
Is anybody experiencing extreme slowness when using Visual Studio 2008? I have a fairly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.