{"id":119,"date":"2010-04-01T04:23:50","date_gmt":"2010-04-01T04:23:50","guid":{"rendered":"http:\/\/xbmc\/wordpress\/?p=119"},"modified":"2011-08-14T11:32:28","modified_gmt":"2011-08-14T16:32:28","slug":"enabling-pear-by-setting-your-open_basedir-and-include_path","status":"publish","type":"post","link":"https:\/\/xfloyd.net\/blog\/?p=119","title":{"rendered":"Enabling PEAR by setting your open_basedir and include_path"},"content":{"rendered":"<h1><\/h1>\n<div>\n<ul>\n<li><em>Applies to:<\/em> All (dv)<\/li>\n<li><em>Difficulty:<\/em> Easy<\/li>\n<li><em>Time needed:<\/em> 5 minutes<\/li>\n<li><em>Tools needed:<\/em> <a onclick=\"showHelpTip(event, '<b>root<\/b>root is the user name or account that by default has access to all commands and files on a Linux or other Unix-like operating system. It is also referred to as the root account, root user and the superuser.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>root<\/a>, <a onclick=\"showHelpTip(event, '<b>ssh<\/b>Secure Shell or ssh is a network protocol that allows data to be exchanged over a secure channel between two computers.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>ssh<\/a>, <a onclick=\"showHelpTip(event, '<b>vi<\/b>Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>vi<\/a> knowledge<!--more--><\/li>\n<\/ul>\n<\/div>\n<div>\n<p>Pear comes installed on your (dv) Dedicated-Virtual Server, but to enable it on one of your domains you&#8217;ll have to change the default open_basedir variable.<\/p>\n<p>To change the default of this variable you&#8217;ll need <a onclick=\"showHelpTip(event, '<b>root<\/b>root is the user name or account that by default has access to all commands and files on a Linux or other Unix-like operating system. It is also referred to as the root account, root user and the superuser.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>root<\/a> access which you can ask for in the <a title=\"AccountCenter\" href=\"https:\/\/ac.mediatemple.net\/\" target=\"_blank\">AccountCenter<\/a> if you don&#8217;t already have it.<\/p>\n<div>\n<h3>NOTE:<\/h3>\n<p>Text in this color is used as an example. Please be sure to replace this text with the proper information for your site or server.<\/p>\n<p>Please be aware that the following changes in your vhost.conf file will take precedence over any settings you may have in your httpd.conf file.<\/p>\n<\/div>\n<p>Here&#8217;s how to enable pear on a domain:<\/p>\n<p>1) <a onclick=\"showHelpTip(event, '<b>SSH<\/b>Secure Shell or ssh is a network protocol that allows data to be exchanged over a secure channel between two computers.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>SSH<\/a> into your <a onclick=\"showHelpTip(event, '<b>Plesk<\/b>Plesk is a software package which allows a server administrator to set up new websites, e-mail accounts, and DNS entries through a web-based interface. The administrator can create client and site templates, which predetermine resource allocation parameters for the domains and\/or clients.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>Plesk<\/a> machine as &#8220;root&#8221; and cd to the conf directory for the domain on which you want to enable pear. Something like this should work:<\/p>\n<ul>\n<li><a href=\"http:\/\/kb.mediatemple.net\/questions\/110\/\">SSH access &#8212; (dv) &amp; (dpv) Dedicated-Virtual Servers<\/a><\/li>\n<li><a href=\"http:\/\/kb.mediatemple.net\/questions\/625\/\">How do I enable root access to my (dv)?<\/a><\/li>\n<\/ul>\n<p>For (dv) Dedicated-Virtual Server v2.0 systems:<\/p>\n<pre><code> cd \/home\/httpd\/vhosts\/mt-example.com\/conf\/<\/code><\/pre>\n<p>For (dv) Dedicated-Virtual Server v3.x systems:<\/p>\n<pre><code> cd \/var\/www\/vhosts\/mt-example.com\/conf\/<\/code><\/pre>\n<p>2) Create a file called vhost.conf using the <a href=\"http:\/\/kb.mediatemple.net\/questions\/911\/\">vi<\/a><a href=\"http:\/\/kb.mediatemple.net\/questions\/911\/\"> editor<\/a> with the following contents:<\/p>\n<div>\n<h3>NOTE:<\/h3>\n<p>If you wish to make PEAR available via https follow the instructions below, but create &#8220;vhost_ssl.conf&#8221; instead of &#8220;vhost.conf&#8221;. If you wish to enable this for subdomains you must create the appropriate vhost.conf files for all subdomains that you need and then reconfigure the main vhost.conf file.<\/p>\n<\/div>\n<pre><code><a onclick=\"showHelpTip(event, '<b>vi<\/b>Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.'); return false;\" href=\"javascript:void(0)\">vi<\/a> vhost.conf<\/code><\/pre>\n<p>For (dv) Dedicated-Virtual Server v2.0 systems:<\/p>\n<pre><code> &lt;Directory \"\/home\/httpd\/vhosts\/mt-example.com\/httpdocs\"&gt; php_admin_value open_basedir \"\/home\/httpd\/vhosts\/mt-example.com\/httpdocs:\/usr\/share\/pear:\/tmp\" php_admin_value include_path \".:\/usr\/share\/pear\" &lt;\/Directory&gt;<\/code><\/pre>\n<p>For (dv) Dedicated-Virtual Server v3.x systems:<\/p>\n<pre><code>&lt;Directory \"\/var\/www\/vhosts\/mt-example.com\/httpdocs\"&gt; php_admin_value open_basedir \"\/var\/www\/vhosts\/mt-example.com\/httpdocs:\/usr\/share\/pear:\/tmp\" php_admin_value include_path \".:\/usr\/share\/pear\" &lt;\/Directory&gt; <\/code><\/pre>\n<div>\n<h3>TIP:<\/h3>\n<p>&nbsp;<\/p>\n<p>If you want to switch off safe_mode on a per domain basis you can add the following line:<\/p>\n<pre><code> php_admin_value safe_mode Off <\/code><\/pre>\n<\/div>\n<div>\n<h3>NOTE:<\/h3>\n<p>If you are having open_basedir problems not related to the use of PEAR you should add the path of the directory you are trying to access after :\/tmp like this:<\/p>\n<p>For (dv) Dedicated-Virtual Server v2.0 systems:<\/p>\n<pre><code> php_admin_value open_basedir \"\/home\/httpd\/vhosts\/mt-example.com\/httpdocs:\/usr\/share\/pear:\/tmp:\/path\/to\/new\/directory\/to\/access\/\" <\/code><\/pre>\n<p>For (dv) Dedicated-Virtual Server v3.x systems:<\/p>\n<pre><code> php_admin_value open_basedir \"\/var\/www\/vhosts\/mt-example.com\/httpdocs:\/usr\/share\/pear:\/tmp:\/path\/to\/new\/directory\/to\/access\/\" <\/code><\/pre>\n<p><sup><br \/>\n<\/sup><strong>Or you can try turning off open_basedir completely like this: <\/strong><\/p>\n<pre><code> php_admin_value open_basedir none <\/code><\/pre>\n<\/div>\n<p>3) Reconfigure your webserver so it will look for your new vhost.conf file by doing this:<\/p>\n<pre><code> \/usr\/local\/psa\/admin\/sbin\/websrvmng --reconfigure-vhost --vhost-name=mt-example.com <\/code><\/pre>\n<p>4) Finally you must restart <a onclick=\"showHelpTip(event, '<b>apache<\/b>An open source Web server that is freely available and can be modified by programmers.&#8217;); return false;&#8221; href=&#8221;javascript:void(0)&#8221;>apache<\/a>, this can be done through Plesk or by executing the following commands:<\/p>\n<pre><code>\/etc\/init.d\/httpd stop \/etc\/init.d\/httpd start<\/code><\/pre>\n<blockquote>\n<h3>Revisions:<\/h3>\n<\/blockquote>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Applies to: All (dv) Difficulty: Easy Time needed: 5 minutes Tools needed: vi knowledge<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/119"}],"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=119"}],"version-history":[{"count":2,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":848,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions\/848"}],"wp:attachment":[{"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xfloyd.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}