What's happen when you try to read another file in /etc/company directory? This error means file doesn't exits.
Accessing /etc directory using PHP's fopen command
-
07-10-2022 - |
Frage
I have a txt file that I need to access via fopen that is located at /etc/company/lastID.txt
via the following script:
$dataFile = "/etc/company/lastID.txt";
$fh = fopen($dataFile, "r");
print_r(error_get_last());
$lastID = fread($fh, filesize($dataFile));
fclose($fh);
The error I am receiving is:
fopen(/etc/company/lastID.txt): failed to open stream: No such file or directory
but the file is definitely there. When I call another file in the same directory using require_once
it is read without issue, only when I use fopen
do I seem to have a problem.
Any thoughts?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow