PHP Pear missing 'MDB2.php'

1.2k views Asked by At

Once this website is moved to another server, I'm getting the following error:

Fatal error: require_once(): Failed opening required 'MDB2.php' (include_path='.:/usr/lib/php5.4:/usr/lib/php5.4/') in /homepages/14/xxxxxx/htdocs/public_html/includes/pdbconnection.php on line 3

I've looked up where Pear might be located via PHPInfo() and I got this (--with-pear=/usr/lib/php5.4) which is why it's looking there for MDB2.php.

Although it's shared hosting I have SSH access. From what research I've done, it seems that typing pear install MDB2 should fix everything, but when I do I get the following response:

WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update Cannot install, php_dir for channel "pear.php.net" is not writeable by the current user

Which leads me to believe I'm sunk... Am I? :-(

Thanks for any help!


When I type pear list I get the following (if that's of any use):

Installed packages, channel pear.php.net:
=========================================
Package              Version State
Archive_Tar          1.3.2   stable
Console_Getopt       1.2.1   stable
DB                   1.7.13  stable
HTML_Template_IT     1.1     stable
HTTP                 1.4.0   stable
HTTP_Header          1.2.0   stable
Mail                 1.1.14  stable
Net_SMTP             1.2.10  stable
Net_Socket           1.0.8   stable
Net_UserAgent_Detect 2.0.1   stable
PEAR                 1.5.0   stable
Structures_Graph     1.0.2   stable
XML_Beautifier       1.1     stable
XML_Parser           1.2.8   stable
XML_RPC              1.5.1   stable
XML_Util             1.1.4   stable

Thanks!

1

There are 1 answers

0
kguest On

It seems you don't have write permissions to the install directory (/usr/lib/php5.4) when logged in as your standard user. Ordinarily I'd suggest you use sudo to run the same command as root.

So something like this:

$ sudo pear channel-update pear.php.net 

But you're on shared hosting so you could either ask support to do that for you or download the required packages and put them somewhere else inside your include_path.