How I Resolved PHP Maximum Execution Time Error on GoDaddy

Steve Sohcot
Oct 3, 2024

--

I was running a PHP script using GoDaddy as the web host, and received the following error:

PHP Fatal error: Maximum execution time of 30 seconds exceeded in {file}

My first thought was to create/update the php.ini file and add this line:

max_execution_time = 300

But that didn’t work on the remote server.

How I fixed it

I created a PHP file this content:

<?php phpinfo(); >?>

Searching for user_ini.filename I saw the file that should should be edited was something else!

I needed to create a file called .user.ini instead of php.ini

Note there’s a period at the start of the filename.

After doing that, I can see the value for max_execution_time changed:

And then my script ran!

--

--