Hi,
We plan on running a crontab on our LAMP server to access a php script that is outside of the www (htdocs) folder. This script basically finds and removes expired records from our database. We would like this script to be situated outside of the root directory so that it is not accessible by the general public. The problem is that this script needs access to files within the root, and we are not sure about how to format the file path to target these files.
Here is where the problem occurs:
$original_file = "./img/uploads/thumbs/tm_{$original_image}";
$open = fopen($original_file, 'w') or die("Unexpected error");
fopen throws an unexpected error because the file is inaccessible from the directory we are running the script. How can we overcome this obstacle?
Thank you.