Were you able to solve the problem?
You say $CFG->dataroot has permissions 755. Who is the owner, which group?
What is the owner and group of the Apache process?
Security and privacy
Moodle data directory files being deleted
This discussion has been locked so you can no longer reply to it.