This problem still persists! And provided solutions that I found did not help.
User case: Virtual linux ubuntuserver (LAMP) with laravel and stuff Mac OSX with telenet connection to server
php-srcipts run as www-data shell scripts run via telnet run as my username jukka
If error log is created by shell script, it becomes to jukka:www-data and then when I try to open the project in my browser, it fails because www-data cannot write to that file.