Dang... I was hoping you would so we could do some real-time troubleshooting and Q&A.
Well... the best I can do is attach what I did to this post along with a little instruction and hope that you can work it out from there! :p
Basically what you'd do is place the two .txt files into the same directory as subdomains.txt and then rename the two files to have a .php extension (don't forget to do this!!).
Now you would simply open up a browser and visit the add_subdomains.php page. If all goes well, it will start the worker processes that will start adding subdomains. The first snag I see is that I'm assuming the php executable has been placed in some bin location so that you can run it just like you would any other command. If this is not so, you'll have to modify line #35 of add_subdomains.php and instead of exec("php -d you'll have to use exec("/path/to/php -d" .
If you encounter any errors (make sure display_errors is set to On and error_reporting set to E_ALL), let me know.
EDIT: Well, not sure... the time limit sounds like it's being enforced by PHP's max execution time. One thing you might try instead is calling [man]ini_set/man at the top of your script and set 'max_execution_time' to something high.
What I find strange is that you mention the 5 minute timeout, which is actually the default timeout for Apache's Timeout directive. In that case, the webserver would be stopping your script after that timeout no matter what time limit you set in PHP. That's why I went with my approach of splitting up the workload.