While installation of Magento you may face such errors and to overcome this error you can either change do a simple thing.
Go to index.php of paste this code after <?php inline 2.
set_time_limit(1800);
This works fine for us. Hope it will work for you too.