From this site: http://www.php.net/manual/en/ini.php
'upload_max_filesize' and 'post_max_size'
are of type PHP_INI_PERDIR
which means Entry can be set in "php.ini, .htaccess or httpd.conf". So you can't set it in your script.
--- Edit ---
A similar question: Changing upload_max_filesize on PHP
--- Edit 2 ---
Something I would like to give a try when I have some time is http://nodejs.org/