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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:11:48+00:00 2026-06-18T02:11:48+00:00

I have looked all over the Internet and all over Stack Overflow and I

  • 0

I have looked all over the Internet and all over Stack Overflow and I am unable to find a solution to my problem.

I basically have a PDF file which I am able to access through a web address if I hit in a web browser.
Without away, it is: http://url.com/manage/pdf/file.pdf?id=172). I know it seems unusual, but trust me, hitting this address gives my a PDF file.

But if I try an hit it using file_get_contents, I get an error:

failed to open stream: Connection timed out (obviously I have cut out file names and line numbers).

I am not looking to to suppress the error (I already can do this), nor am I looking it for a way to handle the error. I want to know WHY the error is happening so I can stop it from happening.

Particularly as this same line of code has no issues with getting other files in a similar manner.

Because of constraints beyond my control, I can not use cURL.

The file is less than 1MB and all the relevant settings in php.ini have been checked (can’t remember them off the top of my head, but allow open socket, and socket time outs).

Can anyone give me an answer that I have not seen already that will actually work! Let me know if you need more details.

Thank you in advanced!

  • 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-18T02:11:50+00:00Added an answer on June 18, 2026 at 2:11 am

    You can’t put a file to a remote server. If you are trying to open the PDF from that site you need to use file_get_contents().

    http://url.com/manage/pdf/file.pdf?id=172

    Your link includes the word ‘manage.’ If you need to be logged in to see that file then yes your browser would see it but PHP cannot because it isn’t logged into the server. The second issue is if I view that link I am redirected to http://www.coolchaser.com/?id=172. If you are dealing with a link that may have a redirect you should switch to CURL and in the curl options you tell it to redirect and the number of levels of redirection that are allowed.

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://url.com/manage/pdf/file.pdf?id=172');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    $result = curl_exec($ch);
    curl_close($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked all over the internet to find an answer to my problem
I have looked all over stackoverflow and internet, still can't find a solution for
I have looked all over for a solution but can't find anything specific and
I have looked all over the internet to try and solve this problem. Can
I have looked all over the internet but could not get one final solution
I've looked all over the internet trying to find an answer to my problem,
I have looked all over the web and cannot find exactly what I am
I have looked all over the web and I can not find the information
but i have looked all over the internet and no one seems to be
I have a small issue. I have looked all over the internet but 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.