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

  • Home
  • SEARCH
  • 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 9023141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:41:27+00:00 2026-06-16T05:41:27+00:00

there are many questions on this topic, but I couldn’t find an answer to

  • 0

there are many questions on this topic, but I couldn’t find an answer to my scenario.

The client project I am working on is hosted on a server running PHP 4.3.9 and I am trying to copy a remote image to the server. This always fails with a timeout:

var_dump(
   copy('http://domain.com/path/to/image.jpg', 
        '/opt/www/myfolder/myimage.jpg')
);

The error message for this being: Warning: copy(http://domain.com/path/to/image.jpg): failed to open stream: Connection timed out in /opt/www/myfolder/my-script.php on line xx bool(false)

I did a trace of several ini settings, which would seem fine to me.

var_dump(
    ini_get('upload_max_filesize'), 
    ini_get('post_max_size'), 
    ini_get('max_execution_time'), 
    ini_get('max_input_time'), 
    ini_get('allow_url_fopen'));

This traces:

string(2) "8M" string(2) "8M" string(2) "30" string(2) "60" string(1) "1"

So allow_url_fopen seems to be enabled, and the other settings seems fine too. I tried different images, all accessible via browser, all with small sizes, different remote hosts. My server’s target directory is writable and copying for example a file from my own server’s URI copies the file just fine.

I also tried a curl variant from this answer, with same result.

When I try the same script on a different server with newer PHP version it works fine.

What setting on the project server can cause this to fail? Is there something about PHP 4.3.9 I am missing that causes this to fail?

Please, please note that I cannot change the PHP version and I have no need for answers advising me to upgrade or convince my client to upgrade

Edit: Changed upload_max_filesize to 40MB and max_execution_time to 600 with no different result.

  • 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-16T05:41:28+00:00Added an answer on June 16, 2026 at 5:41 am

    As pointed out by @Charles and @SalmanA in the comments, there seems to be a connectivity problem on the server preventing the copy calls.

    Based on @SalmanA’s comment, trying to use wget from the ssh shell showed a similar timeout result, indicating a blocked connection.

    Contacting the server host and inquiring further is the solution here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many questions like this question but I can not find exact answer.
There are a lot of StackOverflow questions on this topic, but I couldn't find
There are many question regarding this topic but there is no clear answer. Although
There are many questions like this but I can't find one that seems to
There are many questions like this, but none of them seem to answer my
There seem to be many questions in around this topic but none seem to
I know that there have been many similar questions on this topic but none
I know there are many questions concerning this topic but after reading them all
All, there are many question on the above topic but I believe this is
I know that there are many different questions about this sort of topic on

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.