"/jobops/*.txt"
is an absolute path on *
nix, if you want to point to the directory that is in the same directory as a your php script you need to use:
"jobops/*.txt"
which is a relative path.
"/jobops/*.txt"
is an absolute path on *
nix, if you want to point to the directory that is in the same directory as a your php script you need to use:
"jobops/*.txt"
which is a relative path.
maybe something like:
$files = glob($_SERVER['DOCUMENT_ROOT']."/jobops/*.txt");
If you are running this from a web server? Could it be the User and Group settings of the web server will not allow access to other directories? Is this a permissions issue? Check the web server's error_log and access_logs for clues.
As said
"/jobops/*.txt"
is an absolute path since it starts with a "/" (slash)
Relative paths are those not starting with a slash, so
"jobops/*.txt"
"./jobops/*.txt"
"../jobops/*.txt"
are all relative ... the point is: relative to what?
On OSs it is relative to the directories enumerated in the environment variable PATH (and often the current working dir is the first one listed into this variable, leding to the erroneous guess that "jobops/*.txt" is referred to the jabops dir in the current dir!)
In PHP, that is you environment, it is better to always use absolute paths, which does not implies to hard code them of course.
I suggest to do the following:
dirname(__FILE__).'/jobops/*.txt'
which is how to use paths in PHP, correctly