Tips and tricks for LAMP (Linux Apache MySQL PHP) developers.

When I cant find a suitable solution to a problem and have to work it out for myself I'll post the result here so hopefully others will find it useful. (All code is offered in good faith. It may not be the best solution, just a solution).

Friday, 6 February 2009

"shell_exec(): Unable to execute"

I spent ages trying to get round this PHP warning today:

"PHP Warning: shell_exec(): Unable to execute '[any bash command]'"

I hadn't changed anything and it was working 5mins before so what was wrong?

A colleague of mine suggested restarting Apache... and it worked!
I don't fully understand why, something to do with Apache running out of resources or something. Anywho, thought it might be useful for someone.