in reply to Script works differently on two different servers

Instead of wondering blindly what's happening, simply read what Apache has to say about it. There's usually an error.log file containing the error messages, by default in /var/log/apache2/error.log or so.