Here is a PHP script:
<?php
$pathToDirectory = "/var/www/html/Tests/Workspace/data";
echo "pathToDirectory: " . $pathToDirectory . "
";
?>
In my Ubuntu 16.04 OS, I am trying to execute this script every minute as a part of a cronjob. I have added the cronjob like so to my root
's crontab file:
* * * * * /var/www/html/Tests/Workspace/phpScript.php >/var/www/html/Tests/Workspace/logs/cronScriptOutput.out
And the cronjob runs successfully. The problem is that once the cronjob has run, following are the contents of the cronScriptOutput.out file.
pathToDataDirectory:
And that's it. That actual path string is NOT printed.
The question is why? How do I fix this.
This might not seem serious here, but the problem is that I need to read a file from that path and go further from there. So I need this fixed. I need that path to be read in my PHP script.