• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Problems with php open_basedir

Status
Not open for further replies.

jiHymas1

New Pleskian
I have a php programme whereby clients subscribe to and download my newsletter. I charge for these newsletters, so I want to keep them inaccessible from external processes. So they're kept in a directory C:\prefletters\

My downloading procedure indicated an error, so I adjusted the php settings inside Plesk, restarted the server and tried again. Same error.

I adjusted the php.ini file indicated by phpinfo() by adding the line:
open_basedir = C:/Inetpub/vhosts/prefinfo.com\;C:\Windows\Temp\;C:\prefletters\
... following which I restarted the server ...

... and I still get the same error as always:

Warning: filesize() [function.filesize]: open_basedir restriction in effect. File(C:\prefletters\prefLetter.pdf) is not within the allowed path(s): (C:/Inetpub/vhosts/prefinfo.com\;C:\Windows\Temp\;C:\prefletters\) in C:\Inetpub\vhosts\prefinfo.com\prefletter\download.php on line 56

******************************

Why is this? How can I modify open_basedir properly?
 
You shouldn't specify open_basedir in php.ini
You should specify it in PHP settings for domain in Plesk GUI. These settings will be stored in registry and used with highest priority than settings from php.ini
 
You should specify it in PHP settings for domain in Plesk GUI.

I did that first, but tried php.ini when I kept getting the same error.

However, it turns out that I had not properly set the security settings on the directory in Windows Server 2012; I corrected them and now everything works fine.

I don't know why the system was reporting a problem with "open_basedir restriction in effect" - that could be a php bug, maybe Plesk, maybe some interaction between PHP and Plesk's virtual hosting. But all's well that ends well.
 
Status
Not open for further replies.
Back
Top