When you get an error, take that opportunity to read the docs. In this case, the docs for set_time_limit().
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.