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 7566983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:32:58+00:00 2026-05-30T14:32:58+00:00

I am running on proxy and when i use function file_get_contents i get error

  • 0

I am running on proxy and when i use function file_get_contents i get error like

Warning: file_get_contents(http://www.abc.com/) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\wamp\www\Kurogo123\lib\DataController.php on line 520

How do i solve this problem?

  • 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-05-30T14:32:59+00:00Added an answer on May 30, 2026 at 2:32 pm

    You need to create a stream context to reach beyond the proxy server. Try this:

    // Define a context for HTTP.
    $aContext = array(
         'http' => array(
             'proxy' => 'tcp://127.0.0.1:8080', // This needs to be the server and the port of the Proxy Server.
             'request_fulluri' => true,
             ),
         );
    $cxContext = stream_context_create($aContext);
    
    // Now all file stream functions can use this context.
    
    $sFile = file_get_contents("http://www.example.com", false, $cxContext);
    
     echo $sFile;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running into a problem where on certain servers we get an error that the
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled
http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can
I'm creating an application using the Google Earth plugin ( http://www.google.com/intl/en/earth/explore/products/plugin.html ). Typically, to
My computer is running behind proxy. I want to access url from JavaFX. for
We have a reverse proxy here, running Apache in version 2.2.x Essentially I want
I'm having a problem running Apache + Subversion with SSL behind an Nginx proxy
Running a ServiceHost with a single contract is working fine like this: servicehost =
I am trying to test the use-case of a customer having a proxy with
I am trying to get the PowerBuilder 10.5.2 sample web services application running. I

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.