Results 1 to 7 of 7

 

Thread: PHP or Browser Timeout?

  1. #1
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,123
    Thanks
    247
    Thanked 198 Times in 157 Posts


    Hi all, I need a little help with timeout errors.
    I'm not sure if its the browser timing out or the php script.


    I have written a script to extract the datafiles from my networks but I have to do them one at a time, as when i try to loop through all the merchants in one go - the script timesout and causes it to stop.
    I have set my php timeout to a really high value, and was wondering if explorer had a - timeout value?

    So I suppose my question(s) are:-

    Is there anyway to execute a php script that will take 15 - 20 to run in a browser (and is there another means to execute a php file?)

    And - What is the php equiviant of (in asp) - < % onerror resume next % >?

    Thanks all.

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Norfolk
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Instead of setting the time limit to a high value, try this at the beginning of your script.
    PHP Code:
    set_time_limit(0); 
    It disables the time limit.

    With PHP you can define your own error handling function and call it with
    PHP Code:
    set_error_handler(error_function); 
    It disables the main php error handling function so you are responsible for all aspects of handling the error including die(). If the function returns to the main script then it will resume where it left off.

    The time limit should help so you shouldn't have to resort to writing your own error functions.

    Hope this helps.

    Roger.

  3. #3
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,123
    Thanks
    247
    Thanked 198 Times in 157 Posts
    Cheers Roger

  4. #4
    Meow!

    Status
    Offline
    Join Date
    Jan 2004
    Location
    Manchester
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If your hosting provider gives you access to the shell, then it might be worth running these data file upload scripts from there instead...

    You can run php scripts from the shell as follows:

    php scriptname.php <parameter> <parameter>

    For example, I've written a script as follows:

    php getfeed.php aw 318 download

    This basically gets the csv file for merchant ID 318 from Affiliate Window (without the parameter download it will insert the data from the csv file stored in gz format locally on the server - just in case something goes wrong!)

    Thanks,
    Darren.
    DarrenW

  5. #5
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,123
    Thanks
    247
    Thanked 198 Times in 157 Posts
    Cheers darrenw

    i have access to the shell, do I just place the php file in the same directory as the php.exe?

    Ta

  6. #6
    Meow!

    Status
    Offline
    Join Date
    Jan 2004
    Location
    Manchester
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can put the script wherever you want, but make sure you put the path to the php executable as the first line in the script as follows:

    PHP Code:
    #!/usr/local/bin/php -q 
    Regards,
    Darren.
    DarrenW

  7. #7
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,123
    Thanks
    247
    Thanked 198 Times in 157 Posts
    Sorry forgot to mention that I am on Windows

    I will have a mess around using the 'raw' php.exe though. I'll have a look around php.net to see if there is anything more.

    Thanks



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Anyone anygood with xml, php, mysql and Affiliate Window
    By AnnonnyMouse in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 23-09-04, 11:00 AM
  2. Php & Sql
    By Wunderlust1 in forum Programming
    Replies: 8
    Last Post: 20-08-04, 10:22 AM
  3. PHP - No input file specified. - Problem
    By Barry in forum Programming
    Replies: 1
    Last Post: 02-08-04, 10:57 AM
  4. Downloading a file using PHP
    By wibble99 in forum Programming
    Replies: 10
    Last Post: 19-01-04, 01:15 PM
  5. PHP, cookies and trailing slash
    By NeilDurrant in forum Programming
    Replies: 2
    Last Post: 27-01-03, 08:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2