I'm trying to access a root file that I have created from a plugin I've made, the path seems to be correct but instead, I'm getting the error message.
$file = fopen("~/home/app_name/.token", "r") or die("Unable to open job ads file!");
$access_token_new = fgets($file,filesize("~/home/app_name/.token"));
When I run the file via CLI I'm getting a 401 Unauthorised access due to the fopen failing, any ideas would be greatly appreciated.