<p>You can alter the index.php file and add <code>[set_time_limit][1](300);</code> anywhere below the <code>&lt;?php</code> tag. </p>

<p>You can also try to set it by <code>ini_set('max_execution_time', 300);</code></p>

<p><em>For the reason why it returns a 500 Internal Server Error, the server does not support the <code>php_value</code> and <code>php_flag</code> parameters through the htaccess file or it doesnt use the php5 module. You can try setting the <code>php_value</code> directly and check again for errors, or contact your hosting provider for support</em></p>

CC BY-SA 3.0
2016-02-26T12:56:42.260Z
Thanks! `ini_set('max_execution_time', 300);` works fine
Jonathan Schiffner
CC BY-SA 3.0
2016-02-26T12:43:57.080Z
2016-02-26T12:43:57.080Z
chris
<p>I want to change the max_execution_time in the .htaccess file. I tried it in this way: <code>&lt;IfModule mod_php5.c&gt; php_value max_execution_time 300 &lt;/IfModule&gt;</code> but then I got a <em>500 internal server error</em>. 
My .htaccess file also includes this: </p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;
</code></pre>

<p>Any idea why I got this error? Or how I can change the max_execution_time in an other way?</p>

<p>(I sadly do not have the possibility to change the php.ini)</p>

<htaccess>
.htaccess max_execution_time
# .htaccess max_execution_time

(Asked by: username_0 on 2016-02-26)

I want to change the max_execution_time in the .htaccess file. I tried it in this way:  php_value max_execution_time 300  but then I got a 500 internal server error. 
My .htaccess file also includes this: 

    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]


Any idea why I got this error? Or how I can change the max_execution_time in an other way?
(I sadly do not have the possibility to change the php.ini)

**Tags:** htaccess

---

## 1 answers

### Answer by username_1 on 2016-02-26. Score: 4 | Accepted answer

You can alter the index.php file and add `[set_time_limit][1](300);` anywhere below the `php</code tag.`

You can also try to set it by `ini_set('max_execution_time', 300);`

*For the reason why it returns a 500 Internal Server Error, the server does not support the `php_value` and `php_flag` parameters through the htaccess file or it doesnt use the php5 module. You can try setting the `php_value` directly and check again for errors, or contact your hosting provider for support*

> **Comments:**
> **username_0**: Thanks! `ini_set('max_execution_time', 300);` works fine  

---

