daemon user is not
root, so it is not allowed to change the mode of a file owned by a different user. PHP safe_mode is not the cause here. The warning is telling you that the attempted operation failed because the web server user did not have permission to make the mode change.
The operation succeeded after you manually changed the ownership of the file to
daemon because users are allowed to change the mode of files they own.