Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 03-29-2009, 09:17 PM
s17 s17 is offline
Hatchling Croc
 
Join Date: Mar 2009
Posts: 3
Default PHP script stops randomly!

Hi all,

I run a PHP script which adds products to a MySQL db. The script finds new products to add in batches, and adds them in batches. However, since transferring the script to hostgator, the script stops running randomly, usually at the beginning of one of the batches being injected to the db. Since this never happened before when I hosted the scripts from WAMP/LAMP, I am guessing there is some kind of memory or timeout issue occurring. Can anyone help or offer ideas?

Thanks!
Reply With Quote
  #2  
Old 03-29-2009, 10:36 PM
s17 s17 is offline
Hatchling Croc
 
Join Date: Mar 2009
Posts: 3
Default Re: PHP script stops randomly!

I just deduced that the "interruption" is occuring exactly between these two lines:

include_once('mysql.php');
$mysql = new MYSQL();

I am still baffled as to why this line is stopping the script...
Reply With Quote
  #3  
Old 03-29-2009, 10:48 PM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: PHP script stops randomly!

First of all, there should be no problem whatever with a properly coded PHP script adding any reasonable number of records to a MySQL table. I run such a script on my shared server that adds 108,731 geoIP records in just a few seconds.

Scripting logic suggests that the failure is occuring with attempted execution of the include_once instruction. And that, in turn, suggests that either it isn't finding what it's trying to include or else some aspect of the include file itself is corrupting the process.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
  #4  
Old 03-31-2009, 04:37 PM
s17 s17 is offline
Hatchling Croc
 
Join Date: Mar 2009
Posts: 3
Default Re: PHP script stops randomly!

Turns out hostgator kills any connections that take longer than 30 seconds.. The default timeout is 8 hours. I am filing a ticket right now to increase the limit to something reasonable (I need at least 5minutes for some scripts). I will keep you all posted.
Reply With Quote
  #5  
Old 03-31-2009, 05:35 PM
virtvir5's Avatar
virtvir5 virtvir5 is offline
King Croc
 
Join Date: Feb 2009
Location: Parry Sound, Canada
Posts: 1,245
Default Re: PHP script stops randomly!

Huh?! If its timing out following an "include_once" instruction as per your original post, that must be one heck of an include file.

Not sure where you think you're gonna get a PHP max_execution_time setting of 8 hours or anything like that, but I'm willing to bet that HG won't even consider 5 minutes.
__________________
Regards, Richard
VIRtech.org
Reply With Quote
  #6  
Old 03-31-2009, 10:33 PM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: PHP script stops randomly!

Quote:
Originally Posted by s17 View Post
Turns out hostgator kills any connections that take longer than 30 seconds.. The default timeout is 8 hours. I am filing a ticket right now to increase the limit to something reasonable (I need at least 5minutes for some scripts).
8 hours max_execution_time for a script on a $10 p/month shared server..... not likely.

8 hours for a script on any server ..... still not likely.

30 seconds is the default, not 8 hours.

My bet is that HG will tell you to fix your script or move to a dedicated server.

From the ToS:
Quote:
7. Resource Usage
User may not:
a) Use 25% or more of system resources for longer then 90 seconds. There are numerous activities that could cause such problems; these include: CGI scripts, FTP, PHP, HTTP, etc.
__________________
- David
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone know a script like this? DannyD Off-Topic 5 09-27-2008 01:31 PM
Running a python script just gives me the txt of the script Meridian66 Shared Hosting Support 14 07-16-2007 09:05 PM
PHP Sessions Randomly Lose Variables wisewolfe Pre-Sales Questions 1 08-21-2004 09:55 AM

All times are GMT -5. The time now is 10:15 PM.