Your question couldn't be more vague but one of your comments suggest that you expect an error message when you feed cat
with an invalid file. Well, that's not how cat
actually works. As most classic Unix commands, it writes error messages into standard error (stderr) rather than standard output (stdout). You either need to use a PHP function that allows to capture stderr (such as proc_open) or redirect stderr to somewhere else (such as stdout or a file).
Apart from that, PHP program execution functions have many optional parameters and return values and you are ignoring them all. For instance, system() returns the last line of the command output on success (and FALSE
on failure) and allows to capture the return value (which will be non-zero in case of error and is the standard mechanism to detect errors).