![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
PHP Script Timeout Problem
I am trying to grab some data from a website (http://www.aftenposten.no) but when I attempt to do so the website takes to long to return and causes the php timeout to kick in on my host. Can anyone think of a way that I might be able to overcome this timeout problem? Bearing in mind that I have no access or permission to access the php.ini file on this server I have to work with.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
PHP manual . Presuming it's a script timeout. Note the various caveats.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Expert Programmer
|
Yeah, interesting function, didn't know about it. In any case though I am pretty sure that the host is running PHP in safe mode... I will run a phpinfo to find out though. Thanks.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#4 |
|
Expert Programmer
|
Another option I just found out about is the init_set option. Even when in safe mode this sometimes will work and allow the maximum execution time to be modified. It will be interesting to see if the host will allow for this.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
you can change php variables like max_execution_tiem (i'm not sure what the actual name is) in your .htaccess file. Just add a line
php_value variable value like php_value register_globals ON I would seriously look at your code though cause 99.9% of the time you get those errors its because you have a loop that doesnt end.
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Aren't you your host, Kurifu? :p
|
|
|
|
|
|
#7 | |
|
Professional Programmer
|
Quote:
|
|
|
|
|
|
|
#8 | |
|
Expert Programmer
|
Quote:
![]() I did manage to solve the problem. Any time spent calling system( ) or exec( ) does not count as script execution time. Since I could not change the values in this case as PHP safe_mode was turned on, I simply stopped running my system calls in the background, serialized them and spent the time out of script to process the long ugly tasks... it worked like a charm.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
|
#9 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
.htaccess....I just took a crash course in mod_rewrite and php today. Ow.
I decided that it would be nifty to have all my site data in xml files and have them transformed by the browser using an XSL stylesheet. Works like a charm. However, there's the small detail that search engines and xml+xsl don't mix. So I proceeded to write a script that parsed the xml and returned an overly simplified version of the page. I combined that with two mod_rewrite rules, one to redirect Googlebot to the /basic directory and another to cause the imaginary /basic directory to map to my script. It works...finally. Back on the topic, some php directives can be set in .htaccess while others must be in httpd.conf/php.ini. This page gives the breakdown. The ones listed as PHP_INI_SYSTEM can only exist in the server config/php.ini while the others can be in .htaccess. These commands are the ones used to set the directives from the Apache files rather than PHP.ini. Wow...didn't know any of that this morning ![]()
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|