简体   繁体   中英

zend framework 2 Reconnect to database

I've got a MVC Skeleton Application with my own Module. My Controller converts PDF Files into Jpgs. If the script not run more than 10 Minutes everything is ok. But if it takes longer, I get the Error "MySQL Server has gone away". I tried to lift the mysql wait time up, but it's on a shared Webspace. So I have no Chance for that.

My Controller gets the database Connection from my application. But if the script arrives the model, it's gone away.

Maybe I'm too stupid, but I can't find a way to reconnect the database from the Controller or the model.

Does anybody know a solution?

Thx

Check you mysql server timed out and closed the connection.

To fix, check your wait_timeout mysql variable in your my.cnf configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM