I would suggest Mr Ben's method rather than editing php.ini, which is not particularly appropriate in most cases. Editing the .ini values in script instead allows for portability, gives easier access to changes and prevents your script and any others on the site from running away with excess resources, obviously very important on a shared server. You can raise the value immediately before you need it and then reset it afterwards to be safe.
PHP Code:
ini_set('max_execution_time', '60');
ini_set('upload_max_filesize', '16M');
YOUR SCRIPT HERE
ini_restore('max_execution_time');
ini_restore('upload_max_filesize');
Change the numbers to suit, of course.
