Note that for fopen() to create files when called with such mode, the path you have given needs to exist as fopen() cannot create directories; but only files it can create. This is normal behavior.
<?php
// Write log file, create if not exists
$log = fopen('/var/logs/someapp/error.log', 'wb');
// This will silently fail if /var/logs/someapp directory doesn't exist
?>