Jump to content
php.lv forumi

laikam execution timeout pie resaizoshanas


ViszinisA

Recommended Posts

Fatal error: Maximum execution time of 30 seconds exceeded in c:\webserver\apache\htdocs\ideas\picres.php on line 49

 

Q1: kas tas ir?

Q2: kur to var nomainiit?

Q3: vai var nomainiit ka tieshi shai lapai limits ir lielaaks?

 

Q4: varbuut mans kods suukaa? bet 15 bildes = 30 sec KODS SHEIT

 

Q5: kas shodien jauns? {prikols}

 

 

tas kods uzrakstiits lai arii buutu man info izstraades laikaa un tad nu shis iedod man kaut ko shaadu:

 

 

in Trial Examens Latv val is file 100_0332.JPG with size 1728x2304 and new size will be 113x150

1. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0333.JPG with size 1728x2304 and new size will be 113x150

2. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0334.JPG with size 1728x2304 and new size will be 113x150

3. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0335.JPG with size 1728x2304 and new size will be 113x150

4. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0336.JPG with size 1728x2304 and new size will be 113x150

5. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0337.JPG with size 1728x2304 and new size will be 113x150

6. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0338.JPG with size 1728x2304 and new size will be 113x150

7. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0339.JPG with size 1728x2304 and new size will be 113x150

8. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0340.JPG with size 1728x2304 and new size will be 113x150

9. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0341.JPG with size 1728x2304 and new size will be 113x150

10. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0342.JPG with size 1728x2304 and new size will be 113x150

11. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0343.JPG with size 1728x2304 and new size will be 113x150

12. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0344.JPG with size 1728x2304 and new size will be 113x150

13. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0345.JPG with size 1728x2304 and new size will be 113x150

14. image loaded | small img saved | normal img saved |

in Trial Examens Latv val is file 100_0346.JPG with size 1728x2304 and new size will be 113x150

15. image loaded |

Fatal error: Maximum execution time of 30 seconds exceeded in c:\webserver\apache\htdocs\ideas\picres.php on line 49

 

 

beigaas FATAL ERROR :))))

Link to comment
Share on other sites

Globāli to var nomainīt php.ini failā zem max_execution_time. Lokāli failā vari izmainīt ieliekot set_time_limit(sekundes) - tad tavs skripts drīkstēs vēl tik ilgi 'vilkties'. Ar katru nākamo f-jas izsaukumu iepriekšējais limits tiek novākts un darbojas jaunais, tādēļ droši var likt ciklā iekšā un ja cikls būs sanācis bezgalīgais, php darbosies mūžam. :D

 

P.S. Es tavā vietā izmantotu funkciju imagecreatefromjpeg/ gif/ png nevis imagecopyresampled, kaut gan neesmu īsti pārliecināts, vai tā ir labāk.

Edited by GedroX
Link to comment
Share on other sites

A1: Skripta maksimālais izpildes laiks (jebšu precīzāk paziņojums par tā pārsniegšanu).

A2: php.ini max_execution_time = 30 jauzliek lielāks (apache pēc tam jānorestartē)

A3: lapas sākumā ini_set('max_execution_time',60); vai set_time_limit(60) piemēram

A4: Pavirši paskatoties likās ok..

Link to comment
Share on other sites

A1: skatoties, cik spēcīga mašīna tev stāv.

A2: Neko īpaši gudrāku tur nevar izdarīt.. Vienīgais, ja domā darīt kautko nopietnu, ieteiktu uzreiz thumbnail-us netaisīt, bet gan uzticēt to cron-am (schedule task), lai ik minūti kādus 10 uztaisa, lai nav tik lielas un pēkšņas noslodzes.

Link to comment
Share on other sites

Vienīgais kam varbūt varētu piesieties ir kāpēc tu pārseivo arī lielo bildi ja tu to nemaz neresaizo?

 

If (false !== ($m = imagejpeg($img_old,'bildes/'.$gal.'/large/'.$file)))//save lielo

{

echo "normal img saved | <br>";

}

Link to comment
Share on other sites

varbuut tapeec ka normaali

 

ir mape

Bildes ->

 

Tad ir mape

 

Bildes -> Tmp (kur glabaajas visas bildes kuras buutu jaaposto JAUNAS tipa)

 

peec tam no tmp njem visas mapes un kopee uz

 

Bildes -> Gal_name -> large un small

 

uz large kopee normaalu neresaizotu

 

 

 

Q1: kaaa lieto cron-am (schedule task)????

Link to comment
Share on other sites

varbuut tapeec ka normaali

 

ir mape

Bildes ->

 

Tad ir mape

 

Bildes -> Tmp (kur glabaajas visas bildes kuras buutu jaaposto JAUNAS tipa)

 

peec tam no tmp njem visas mapes un kopee uz

 

Bildes -> Gal_name -> large un small

 

uz large kopee normaalu neresaizotu

Q1: kaaa lieto cron-am (schedule task)????

Nu tad dari to ar http://lv.php.net/rename nevis ar imagejpeg() :)

Link to comment
Share on other sites

×
×
  • Create New...