App Engine does not allow writing to files, instead write to and read from Cloud Storage.
Write to Cloud Storage
$file = 'gs://<your-bucket>/hello.txt';
file_put_contents($file, 'hello world');
Read from Cloud Storage
$contents = file_get_contents($file);
var_dump($contents);