Using PHP v5.6.40 under Ubuntu 18.04.04 (through php5.6 apache mod), this is the line of code:
file_put_contents('/tmp/deploy.hook.log', date('Y-m-d H:i:s') . ': ' . $data . "\n", FILE_APPEND);
It works in every other server / environment I have set but not here for some reason, no PHP errors or permission issues; the function also returns the number of bytes written even though the file remains empty.
Other interesting thing is that if I run the code using the php cli as www-data it works fine.
Any thoughts?