If you can get into Moodle at all, check under Site Administration > Server > PHP Info specifically for "Loaded Configuration File" which will tell you where to change the php maximum execution time.
If you can't get into Moodle at all, create an info.php in your wwwroot with the following:
<?php
phpinfo();
?>
Then access it in your web browser and again, look for where it's loading the configuration file.
If the php.ini value is high enough, then perhaps you're being caught by the Apache timeout instead. Find your httpd.conf and adjust or add a "TimeOut" setting to increase the execution time allowed by Apache. Default here is 300 seconds (5 minutes), which is already pretty long. Still, if you're on a slow computer and need it...
TimeOut 600
Or whatever is long enough for it to work.