Ask Your Question

Timeout Issues pulling Data in PHRETS

asked 2020-12-02 16:56:16 -0500

I'm trying to pull about 1000 records and I get about 400 records in before I get the message "Maximum execution time of 120 seconds exceeded". Is there anyway around the 120 seconds?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-12-02 17:25:48 -0500

updated 2020-12-08 09:47:41 -0500

You can try this to handle connection timeout:
ini_set("default_socket_timeout", 6000); // seconds

The "Maximum execution time of 120 seconds exceeded" is a PHP script execution error, not RETS.
Internet search for that error, shows you may be able to add this to your script:
ini_set("max_execution_time", 300); // 300 seconds
Or set the value directly in the PHP.INI file.
max_execution_time = 300

edit flag offensive delete link more


Were you able to get this working?
Also, what RETS URL were you using?

bwolven gravatar imagebwolven ( 2020-12-07 08:50:45 -0500 )edit

Yes, it worked. I ended up adding ini_set("max_execution_time", 0); to my functions.php file for a WP site since 300 seconds wasn't long enough. Thanks!

zslagowski gravatar imagezslagowski ( 2020-12-09 12:44:34 -0500 )edit

Glad to hear that you got it working now.
One thing to remember is that there are other factors that can add into the script timing.
Writing out the data to a file or to a database which can all add to the script execution time.

bwolven gravatar imagebwolven ( 2020-12-09 18:08:27 -0500 )edit

answered 2020-12-08 07:25:49 -0500

We have had this issue as well. We now pull 100 properties at a time, pause for a few seconds, and then reconnect. Our process is to pull listings into a local database overnight and download associated images. We purge images once/week for properties no longer in the database.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-12-02 16:56:16 -0500

Seen: 49 times

Last updated: Dec 08 '20