I have the following script: /var/www/vhosts/default/download/index.php
I am using readfile(); to serve files:
$path = '/data/'. $arr["$product"] .'';
readfile($path);
But The following error is generated:
[error] [client xx] PHP Warning: readfile(/data/xxx.iso): failed to open stream: Permission denied in /var/www/vhosts/default/download/index.php on line 33, referer: http://zxc.com/
I thought it is caused by permissions, therefor I gave 777 to the /data directory and 777 to the files in /data, but didn't solve the problem. Then I changed the owner of the directory + files to apache, but also didn't solve it.
What else could be the problem? Also tried to solve it with open_basedir. but no success.