I am getting an open_basedir error when I believe I should not be.
send_backup.php mails backup-test.gz as an attachment.
This works just fine when backup-test.gz is in the directory
/mydomain.com/lib/
It fails when backup-test.gz is in the directory
/mydomain.com/bkp/
The error is this:
PHP Warning: fopen(): open_basedir restriction in effect. File(/var/www/vhosts/mydomain.com/bkp/backup-test.gz) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/lib) in /var/www/vhosts/mydomain.com/lib/send_backup.php on line 12
However, ini_get('open_basedir') reports the following:
/tmp:/var/www/vhosts/mydomain.com/httpdocs:/var/www/vhosts/mydomain.com/lib:/var/www/vhosts/mydomain.com/bkp
Clearly, the directory /bkp/ is in open_basedir. The script send_backup.php can located anywhere, and it works, so long as the target file is in /lib/.
Both files have identical owner:group and permissions.
Any ideas ?