[fix] stderr replaced with error_log call

The current code uses stderr for logging, which is fine for PHP in CLI mode.
When PHP works as web-server module, stderr is not defined.
error_log works the same as stderr in CLI and web-server mode.