• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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