I haven’t played on a *nix system in ages, so this may turn out to be something simple, like a permissions issue.
I have a PHP script I use for my own site counters (this predates my recent hosting here, so I wanted to stick with the old system). The first time the script runs, I want it to check to see if the data file exists. If it doesn’t (which is the case the first time it runs), I want it to create the basic data file for use with subsequent executions. (I want to avoid writing a dummy ‘starter’ data file to that directory.)
The script runs fine when the data file already exists. It finds it, reads it, updates it and writes it back to disk. It’s been running fine for the month I’ve been hosted here.
The script just doesn’t seem to want to create the new data file when it doesn’t already exist. The file_exists() test and file-create fopen() are in the code before the first attempt to load the data via file().
The PHP script, itself, has permissions of 644.