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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:44:53+00:00 2026-06-13T02:44:53+00:00

I have a PHP script, run via cron, that iterates through a list of

  • 0

I have a PHP script, run via cron, that iterates through a list of sites and gathers data for each site using file_get_contents() against an API URL, then stores this data in a MySQL database. This script runs for 60 different site and we’re seeing up to 5MB of serialized PHP data for each URL pull.

The system works swimmingly on my local MAMP server but, as soon as it’s placed on a remote server, it stops behaving reliably. Sometimes it pulls and stores data but stores less records than the local server. It also finishes with a 504 Gateway error. On a different server, it simply doesn’t finish at all. We’ve upped all the time limits in php.ini and compared what I have locally with the remote server and not seeing anything that stands out.

Is there any way to get a PHP script with these multiple repeated actions to run in a more “piecewise” way? Is there any way to “reset the timer” after each site runs? It need to be automated but setting up a cron against each site (3 URLs per site, 60 sites) just sounds like a nightmare to manage.

Thanks in advance.

  • 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-13T02:44:54+00:00Added an answer on June 13, 2026 at 2:44 am

    The problem may be caused due to reaching the limit of threads of PHP or the web server, it also may be due to rules in the server about number of connections per unit of time.

    If you can split the load and execute those cron jobs at different moments, you will get better results

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

Sidebar

Related Questions

I have some long-running CLI PHP scripts that run regularly via cron. I'd like
On my php host, I have a script that is run by a cron
I have a php script that i run via command line like php file.php
I have a PHP script that I'd like to run both via the browser
I have a php script that is run once a minute. The script runs
I have a php script that inserts data from an Android app into a
I have a PHP script that is kicked off via ajax. This PHP script
I have a PHP script that needs to run from command line. One of
I have a PHP script which fetches data from Salesforce via the Salesforce API
I have a PHP script called customers.php that is passed a parameter via the

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.