{"id":14,"date":"2009-12-15T10:58:17","date_gmt":"2009-12-15T15:58:17","guid":{"rendered":"http:\/\/localhost\/wordpress\/?p=14"},"modified":"2011-08-14T12:08:11","modified_gmt":"2011-08-14T17:08:11","slug":"how-to-enable-pear-packages-in-plesk","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=14","title":{"rendered":"How To Enable PEAR Packages In Plesk"},"content":{"rendered":"<p style=\"margin: 0px 0px 10px; padding: 0px;\">By default, Plesk will install PEAR and a lot of packages, but block any access to it for PHP scripts. It\u2019s fairly easy to enable this, though.<\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">First of all, you need to\u00a0<strong style=\"margin: 0px; padding: 0px;\">edit the VirtualHost<\/strong>\u00a0of whatever domain you\u2019re trying to enable this for. Seeing as Plesk would just overwrite your httpd.conf with the next change you make in the controlpanel, you need to use\u00a0<strong style=\"margin: 0px; padding: 0px;\">a seperate vhost.conf file<\/strong>.<!--more--><\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">The file to edit can be found in the following directory:<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 503px; padding-right: 0px; height: 66px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">\/var\/www\/vhosts\/&lt;my domain&gt;\/conf\/vhost.conf<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">It\u2019s possible the file doesn\u2019t exist, just go ahead and create it. If it does exist, simply edit it. If you\u2019re trying to enable this for a\u00a0<strong style=\"margin: 0px; padding: 0px;\">subdomain\u00a0<\/strong>only, you should edit the following file.<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 504px; padding-right: 0px; height: 66px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">\/var\/www\/vhosts\/&lt;my domain&gt;\/subdomains\/&lt;subdomain-name&gt;\/conf\/vhost.conf<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">Once you\u2019re editting the file\u00a0<strong style=\"margin: 0px; padding: 0px;\">vhost.conf<\/strong>, add the following lines.<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 504px; padding-right: 0px; height: 114px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">&lt;Directory \/var\/www\/vhosts\/&lt;my domain&gt;\/httpdocs&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 php_admin_value include_path \"\/var\/www\/vhosts\/&lt;my domain&gt;\/httpdocs\/:\/usr\/share\/pear\/\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 php_admin_value open_basedir \"none\"\r\n&lt;\/Directory&gt;<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">You can change the Directory-name to reflect whatever directory you\u2019re trying to modify. For a subdomain, you should include the \/subdomains\/&lt;subdomain-name&gt;\/ location as well.<\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">The new vhost.conf only adds the location for the PEAR packages, being \/usr\/share\/pear\/. Make sure to keep your normal httpdocs directory in there too, otherwise your other includes will fail.<\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">Now, you should let Plesk rebuild its configuration files in order to pick up the changes made in your vhost.conf, by running the following command.<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 505px; padding-right: 0px; height: 66px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">\/usr\/local\/psa\/admin\/sbin\/websrvmng --reconfigure-vhost --vhost-name=my-domain-name<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">Replace \u201cmy-domain-name\u201d with the actual domain name for which you want to enable PEAR. The command above will rebuild the vhost config for that specific domain. If you\u2019re interested in rebuilding it for all your domains, you can use the shorter version.<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 505px; padding-right: 0px; height: 66px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">\/usr\/local\/psa\/admin\/sbin\/websrvmng -a -v<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">At the beginning I said Plesk has a lot of PEAR Packages installed by default, and that\u2019s true. They are however, in a different directory. You can find them all here.<\/p>\n<div style=\"padding-bottom: 15px; overflow-x: auto; overflow-y: hidden; background-color: #f7f7f7; margin: 0px 0px 10px; padding-left: 0px; width: 505px; padding-right: 0px; height: 66px; padding-top: 0px; -webkit-background-clip: initial; -webkit-background-origin: initial;\">\n<div style=\"padding-right: 4px; padding-left: 4px; padding-bottom: 2px; margin: 0px; vertical-align: top; color: #333333; padding-top: 2px;\">\n<pre style=\"background-image: none; line-height: 1.333; overflow-x: visible; overflow-y: visible; margin: 0px; width: auto; font-family: monospace; float: none; clear: none; font-size: 12px; -webkit-background-clip: initial; -webkit-background-origin: initial; border: #cccccc 1px; padding: 0px;\">\/usr\/share\/psa-pear\/<\/pre>\n<\/div>\n<\/div>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">You can copy any package you want or need to \/usr\/share\/pear\/, to enable them.<\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">I suggest you update your PEAR packages before you get started, because Plesk may install quite a few of time, but they\u2019re mostly outdated anyway. Grab your copies from the\u00a0<a style=\"margin: 0px; color: #2970a6; text-decoration: none; padding: 0px;\" onclick=\"pageTracker._trackPageview('\/outgoing\/pear.php.net\/?referer=http%3A%2F%2Fdigg.com%2Fprogramming%2FHow_To_Enable_PEAR_Packages_In_Plesk');\" href=\"http:\/\/pear.php.net\/\">PEAR-website<\/a>, and replace the files on your server.<\/p>\n<p style=\"margin: 0px 0px 10px; padding: 0px;\">That\u2019s pretty much the simplest way to do it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, Plesk will install PEAR and a lot of packages, but block any access to it for PHP scripts. It\u2019s fairly easy to enable this, though. First of all, you need to\u00a0edit the VirtualHost\u00a0of whatever domain you\u2019re trying to enable this for. Seeing as Plesk would just overwrite your httpd.conf with the next change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14"}],"collection":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14"}],"version-history":[{"count":1,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":416,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/14\/revisions\/416"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}