Maximum execution time exceeded

Hi all

I am getting « Maximum execution time of 30 seconds exceeded », when I try to modify a article (quite long article) using ecrire.

Where should I change this default setting?

Thanks in advance…

Iswaria.

  	

Hi Iswaria,

This setting should be in your servers php.ini file. mine is here:

/etc/php5/apache2/php.ini

and this is the line

max_execution_time = 30 ; Maximum execution time of each script, in seconds

Jadi

Iswaria wrote:

Hi,

Jadi's solution is the first patch possible. But it doesn't solve the
initial problem that your page are still slow to be calculated (more
than 30s should never exists on the web ! :slight_smile:

If you can modify php.ini, I would suggest to give more memory to the
php process :
memory_limit 256M
You can also increment the values of realpath_cache_size and
realpath_cache_ttl : sometimes the cache process requires a lot of
files, so php needs more memory/cache to remember where such function
is defined

if you can't modify the parameters of the server, you should search
what makes this page so slow to be calculated :
just add [? or &]var_profile=1 to the url, and you'll have the list of
the mysql queries, with their execution delay (this list appears only
when you are admin and have the session cookie activated)

If you can't do this (because of execution time), try to profile the
blocks which are included in your template. The basic rules is :

- use a cache delay that corresponds to the "modification probability"
(not a second for the navigation area :slight_smile:

- some elements are always the same and should never be recalculated
(like headers and footers) : use a static include for such elements
(#INCLUDE)

- try to use inclusion when it's possible : this will be a lot of elements

- avoid when possible complicated filters that will force mysql to
search elements in an entire table. If it's not possible, I include
the corresponding loop in another template that can be calculated /
cached separately.
For exemple store in cache loops that requires regular expressions :
<BOUCLE_art(ARTICLES){titre==^[aA]}>

- avoid to do a lot of processing (ie a lot of filters) on loops with
junctions between separate table (for example in a loop over articles
that is too slow, prefer {id_mot=1234} to {titre_mot=foo}). Spip makes
it easy to search elements in different tables in a loop, but it has a
cost : it's sometimes better to decompose your loop into two included
loop.

Hope it helps,

.Gilles

Additional links :
- glossary : Glossary - SPIP (indispensable !! bookmark it !!!)
- criteria : Criteria applicable to all loops - SPIP
- filters : SPIP’s Filters - SPIP
- comparaison of static and dynamic inclusion (with #MODELE) :
http://monsitespip.com/spip.php?article29 [in french]
- parameters of php.ini : PHP: Description of core php.ini directives - Manual

-----------
On 10/31/07, Iswaria <iswaria.k@ifpindia.org> wrote:

Hi all

     I am getting "Maximum execution time of 30 seconds exceeded", when I
try to modify a article (quite long article) using ecrire.

     Where should I change this default setting?

     Thanks in advance..

Iswaria.

_______________________________________________
spip-en@rezo.net -
http://listes.rezo.net/mailman/listinfo/spip-en

Gilles Vincent wrote:

- some elements are always the same and should never be recalculated
(like headers and footers) : use a static include for such elements
(#INCLUDE)

hum, the static includes don't have a cache of their own and therefore will be recomputed everytime the cache of the cache of the including template is recomputed.
In that sense, if you have a static include of a "static" part (menu, headers, etc..) in a page often recomputed (e.g. a forum, the search page, etc...), this will be recomputed every time.

So, you should NOT use static includes for these parts, but a normal include <INCLUDE...> and be sure to give a very long cache to the static part, something like: #CACHE{24*365*3600} on the first line of the template.

Pierre