• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Enabling PEAR on Plesk 12

danallen1

Basic Pleskian
An app my client runs needs to run PEAR mail. My understanding is PEAR is "easy" to enable on Plesk. Unforunately, the instructions I have found are not for Plesk 12, and I am unable to determine the location of PEAR.

The instructions I have say the following directives need to go into the vhost.conf for the relevant domain:
Code:
<Directory /var/www/vhosts/<my domain>/httpdocs>
  php_admin_value include_path "/var/www/vhosts/<my domain>/httpdocs/:/usr/share/pear/"
  php_admin_value open_basedir "none"
</Directory>

the directory /usr/share/pear/ does not exist, so those directives are not enabling pear

I found a directory called /usr/share/psa-pear. Should I use that, as in:
php_admin_value include_path "/var/www/vhosts/<my domain>/mydomainsfolder-not-httpdocs/:/usr/share/psa-pear/"

Is there a test to determine if pear is working?

I searched the documentation at this link , but no luck.

Is there a simple answer to enabling PEAR so my app can use PEAR mail?

Thank you.
 
Hi danallen1,

the most common way to install additional pear packages for a domain, is to use include paths. But you use Plesk, so it's far easier now for you!!!


First of all, please inform yourself about the PHP.ini structure with Plesk: Custom PHP Configuration ( online documentation: Administrator's Guide, Plesk 12.0 )

Afterwards, please keep in mind, that you already might have installed additional PHP versions, since they are now supported for "out-of-the-box" - usage. To inform yourself, please read:

[ReleaseNotes] Multiple PHP Versions in Plesk 12 and higher Out of the Box ( KB - article 125 146 )

Please follow as well the suggestions for "How to install "devel" packages", to have the possibilty to install additional modules to each PHP - version. Keep in mind, that EACH PHP - version needs such an additional "devel" - package, so please repeat the described steps for EACH PHP - version on your server.


Now you have the basics, to install all desired packages/modules, using the "pear install NAME_OF_THE_PACKAGE" - command.

Please locate all PEAR executables with the command over your command line:

locate bin/pear

On an Ubuntu system, your results could be:

Code:
/opt/plesk/php/5.2/bin/pear
/opt/plesk/php/5.2/bin/peardev
/opt/plesk/php/5.3/bin/pear
/opt/plesk/php/5.3/bin/peardev
/opt/plesk/php/5.4/bin/pear
/opt/plesk/php/5.4/bin/peardev
/opt/plesk/php/5.5/bin/pear
/opt/plesk/php/5.5/bin/peardev
/opt/plesk/php/5.6/bin/pear
/opt/plesk/php/5.6/bin/peardev
/usr/bin/pear
/usr/bin/peardev

... so a PEAR - installation command for "Plesk PHP 5.4" would look like:

/opt/plesk/php/5.4/bin/pear install NAME_OF_THE_PACKAGE



Back to your initial question:

Is there a simple answer to enabling PEAR so my app can use PEAR mail?
... you would now go to : https://pear.php.net/search.php and you would search for your desired packages.


Now use for a domain with Plesk PHP - version 5.4 installed:

/opt/plesk/php/5.4/bin/pear install Mail
/opt/plesk/php/5.4/bin/pear install Mail_Mime
/opt/plesk/php/5.4/bin/pear install Mail_mimeDecode
/opt/plesk/php/5.4/bin/pear install Net_SMTP
/opt/plesk/php/5.4/bin/pear install Auth_SASL

Test your new installation with the help of: https://pear.php.net/manual/en/package.mail.mail.send.php



Additional notice: Because you missed to inform us about your operating system and your current Plesk version ( incl. MU ) and possible installed Plesk packages, my answer is based for an Ubuntu 14.04 system with Plesk 12.5.30 ( MU #4 - all free additional packages installed ). Please try to inform us with your next post/thread about your operating system as well, to get a more specific answer and keep in mind, that the more basic information you provide, the better will be the answers for you. ;) It might help to read as well: [IMPORTANT]: READ THIS FIRST TO FIND QUICK SOLUTION FOR THE EXISTING ISSUE/QUESTION .
Please consider as well to use "Like" and/or "Best Answer" options here in the forum, to improve the forum and to help forum users to find answers to their questions and/or issues/problems. You find these options on the bottom of each post here in the forum.
 
First of all, please inform yourself about the PHP.ini structure with Plesk: Custom PHP Configuration ( online documentation: Administrator's Guide, Plesk 12.0 )
I am wondering how the apache directives in vhost.conf are being overridden. What i have in there is
<Directory /var/www/vhosts//httpdocs>
php_admin_value include_path "/var/www/vhosts/pearmailtest.hlows.com/httpdocs/:/usr/share/psa-pear/"
php_admin_value open_basedir "none"
</Directory>

upload_2015-10-7_23-27-55.png

Afterwards, please keep in mind, that you already might have installed additional PHP versions, since they are now supported for "out-of-the-box" - usage. To inform yourself, please read:
on the new server I spun for the purpose of testing pear mail, I made certain to exclude that.
upload_2015-10-7_23-17-4.png



Please follow as well the suggestions for "How to install "devel" packages", to have the possibilty to install additional modules to each PHP - version. Keep in mind, that EACH PHP - version needs such an additional "devel" - package, so please repeat the described steps for EACH PHP - version on your server.
avoider per above. BTW, if this is your idea of easy, this proves my belief that pear is worth avoiding like the plague.

... you would now go to : https://pear.php.net/search.php and you would search for your desired packages.
One of the things I don't kinow is how to install pear packages once i have found them. Is there anything wrong with apt-get install php-pear followed by pear install Mail Mail_Mime Mail_mimeDecode Net_SMTP Auth_SASL

Your list of required packages is extremely helpful, thank you.
 

Attachments

  • upload_2015-10-7_23-25-24.png
    upload_2015-10-7_23-25-24.png
    16.6 KB · Views: 7
  • upload_2015-10-7_23-29-9.png
    upload_2015-10-7_23-29-9.png
    22.1 KB · Views: 6
Last edited:
Back
Top