You can set the time limit is several places, php.ini, in the .htaccess file if the host allows it or in a php file. I’m afraid that the worse issue is the memory limit error. 268435456 = 256MB. You can increase the allowed memory in the same places, you can try increasing it but some hosting providers have a max on this and it is also limited by the physical memory of the server.
http://davidwalsh.name/increase-php-memory-limit-ini_set
http://php.net/manual/en/function.set-time-limit.php