Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-2006, 04:15 PM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,149
Rep Power: 18
Lop will become famous soon enoughLop will become famous soon enough
Default Maximum Execution Time

I am doing a PHP script that pulls a ton of data from two different database tables. While executing the script I receive a Fatal Error: Maximum execution time exceeded 30 seconds. Is there a way to fix this? Is the way I am pulling the data from the DB causing this or is it because of so many results?
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-14-2006, 05:05 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

Well I believe the execution time has to do with the webserver configuration file itself. If you have access to the configuration files you can change the max execution time.

But 30 seconds for 1 query is extremly long, are you sure you havnt created an infinate loop?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-15-2006, 11:06 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,203
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Increase this value in your php.ini

max_execution_time = 30

It wasn't in my php.ini so in that case just add it. The 30 represents the amount of seconds it will wait.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-15-2006, 08:20 PM
Jonas Jonas is offline
Newbie
 
Join Date: Jul 2006
Posts: 25
Rep Power: 9
Jonas is on a distinguished road
Default

Do you have control of your server? If not, most shared hosts put a very low limit on that number to make scripts friendlier to share.

If it is something you can't change, one workaround it is to break up whatever you are doing in segments so it does not timeout in any indivual segment.

I know a few scripts that get around this problem by doing that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-15-2006, 09:25 PM
smith smith is offline
Programmer
 
Join Date: Jun 2006
Posts: 108
Rep Power: 9
smith is on a distinguished road
Default

Quote:
Originally Posted by Jonas
Do you have control of your server? If not, most shared hosts put a very low limit on that number to make scripts friendlier to share.

If it is something you can't change, one workaround it is to break up whatever you are doing in segments so it does not timeout in any indivual segment.

I know a few scripts that get around this problem by doing that.

Yup, that is a good idea. You can limit the amount of data that is pulled at once and have << Prev and Next >> buttons to pull the next amount of data.
__________________
Code:
for (int i;;) {
   cout << "Smith";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP: Execution Time Function Jordan PHP Tutorials 18 Yesterday 02:07 PM
A time showing tutorial ahsan16 VB Tutorials 1 01-10-2007 05:50 AM
Execution Time smith PHP Forum 2 01-06-2007 04:46 PM
Time format xXHalfSliceXx HTML Programming 0 12-10-2006 08:15 PM
Odd Timestamp dirkfirst C# Programming 10 12-08-2006 05:40 PM


All times are GMT -5. The time now is 05:02 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads