Jump to content

Recommended Posts

Hi All,

 

I'm writing an eCommerce system that has a publish feature. All cats/subs and products are read from the database and written to static html files when published. I've got the code for this perfect and it works fine on small sites but sites with larger structures, execution seems to halt after 60 seconds.

 

When the execution stops I don't get any error message what so ever indicating that the execution time has ran out. I've modified the time limit using set_time_limit() just to be sure but this has no affect.

 

If any one has any ideas what could be making PHP halt execution without an error after 60 seconds let me know.

 

Another way around my problem would be to speed up the processing time so that large sites require less than 60 seconds to publish. If any one has any tips on how to write to files efficiently (im currently using fwrites) that would be great too.

 

All the best,

 

Jack

Link to comment
https://forums.phpfreaks.com/topic/85085-ecommerce-php-execution-halts-after-60s/
Share on other sites

Jack,

 

Author of "Commercial Package Contribution" for osCommerce here!

 

You are probably having an issue with MySQL on the site in question.

 

Login to the ISP and find their phpMyAdmin interface for your MySQL DB.

 

See what the timeout and number of record settings are there.

 

Some ISPs disable these so you can not see, change or admin these.  You maybe faced with that dreaded "tech support" call.

 

Keep us posted.

 

OMR

Jack,

 

If the settings are not available, then it's time to get on the phone with tech support.

 

They've most likely disabled them and you have to know their limitations.

 

I always leave all mine open, but for good security the admins are supposed to tighten them down.

 

What that means is you are faced with one of two scenarios:

a.) They relax the settings so your app will run,

b.) You have to add code to the MySQL processing on the backend,

        (that let's you know when the time or row count is exceeded, set a marker in your "SELECT" or "UPDATE"

        sequence and make subsequent calls.)

Also while you have tech support on the phone, ask them to check your .htaccess file, cause sometimes this can lock you out also, when a secure transaction is suppose to run and the certificates validation path is not right.

 

After you chat with tech support, respond with what they say and if it appears to be something else, we'll work through it together.

 

OMR 

Jack,

 

Sorry you were pasting the image while I was replying.

 

Yup it's that "Write" timeout that is nailing you.  If your number of products is large this should be at least 5 minutes or 300 sec.  I'd change the read to half or 2/3'rds that (either 150 or 200).  Test at those levels, if you can change them, then if needed bump them up.  See where the session timer is at 28800 or 480 hours.  I would change that down to 1440 or 24 hours, then as needed work the process timers up, using that as my limit.

 

OMR

Thanks again for the speedy reply OMR!

 

I've uploaded a picture of my new settings but the script seems to timeout around the same time again

 

Any more ideas friend?

 

 

*I've just added a new attatchment. For some reason the old one was here too.

 

[attachment deleted by admin]

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.