Collating some data week by week I serialized an array of the appropriate data and output that to a temporary file using file_put_contents.
Inclusive of some output statements to try and establish what is happening the code looks like this:
echo "<br/> collate session data <br/>";
print_r($this->session_Data);
$serialized_Array = serialize($this->session_Data);
$file_Name = 'session_Data_' . $this->week_Number;
echo "file_Name: " . $file_Name;
file_put_contents($file_Name, $serialized_Array);
The file name definitely gets updated appropriately and there is definitely data to output.
But this will only ever output the first weeks data to the tmp file.
I get no permission errors I get status 200 OK but no files are created.
Am I missing something here??
You are writing the file in the same directory as the script. In a default configuration the webserver process has only read and execute rights in that directory.