• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

PEAR::Mail works in http but not https

S

Superman859

Guest
I have one problem that hopefully isn't too difficult to solve. PEAR::Mail will work for me in http but not in https.

To get it to work in http, I had to add

<Directory /var/www/vhosts/domain.net/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domain.net/httpdocs:/tmp:/usr/share/pear"
</Directory>

to vhost.conf, as well as modifying the include_path in /etc/php.ini to include /usr/share/pear. It seemed to fix the problem, until I tried using it under https.

I have the domain setup to use a single directory for both HTTP and HTTPS (one of the settings under the SETUP tab for the domain - makes updating a lot easier), and I was under the assumption it would work fine. So far, https has worked fine until I added an include of "Mail.php" to them.

I have a feeling this is related to the vhost.conf somehow, although the error in the log is not the same as it was when first setting up PEAR to work in httpdocs. I used to get failed to open, and I added /usr/share/pear to include_path in php.ini for the server. Then I got open_basedir restriction errors, so I had to modify vhost.conf with the code posted above. Then it worked.

Now, http works, but when accessing a page via https, it provides

[phpBB Debug] PHP Notice: in file /var/www/vhosts/domain.net/httpdocs/adm/common.php on line 12: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory

This is similar to the error I was getting the first time around with http, before modifying php.ini. However, looking at the log,

PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Mail.php' (include_path='.:/usr/share/pear') in /var/www/vhosts/domain.net/httpdocs/adm/common.php on line 12, referer: https://www.domain.net/dir/index.php

The include path does indeed include /usr/share/pear, so the cause of the problem doesn't seem to be the same.

Does anyone know what the issue is and how to fix it?
 
Thanks you for the heads up about vhost_ssl.conf. I have been able to make it work, although slightly different than the documentation states. It works (I think - at least PEAR::Mail is included) if

vhost_ssl.conf
<Directory /var/www/vhosts/domain.net/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/domain.net/httpdocs:/tmp:/usr/share/pear"
</Directory>

Which is identical to vhost.conf. The Plesk documentation says to use

<Directory HTTPD_VHOSTS_D/domain.com/httpsdocs>
php_admin_value open_basedir "HTTPD_VHOSTS_D/domain.com/httpsdocs:/tmp:/ADD_PATH"
</Directory>

(modifying the correct places, of course). The main difference is the first line where the directory is listed, the docs say to use httpsdocs, and the same applies for the first location in open_basedir. However, it would not work for me if I did that, I had to change both locations to httpdocs.

Is this because I have it set in Plesk to use the same directory for both? I just want to make sure I am doing it right. It appears to work.
 
If you set Plesk to use httpdocs for both HTTP and HTTPS, then I guess that you indeed need to use httpdocs instead of httpsdocs.
 
Back
Top