Answer the question
In order to leave comments, you need to log in
Why isn't a file being written when running PHP from the console?
There is a code:
$fp = fopen("1.txt", "a");
fwrite($fp, "example");
fclose($fp);
Answer the question
In order to leave comments, you need to log in
Actually two options.
1. He writes, but not in the place you expect.
2. He does not write due to lack of rights.
For the first case, use
To know where the file is being written or is trying to write.
For the second case, check the results returned by fopen/fwrite.
And enable error display.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question