Pear on Dreamhost

software development

#1

Hello,
I am having real problems using pear on dreamhost.
I have installed a local version of pear at http://constructionplantirl.ryancouser.com/backoffice/php/PEAR/ and tried to include it into my page using

<?php ini_set( 'include_path', ini_get( 'include_path' ) . PATH_SEPARATOR . "/home/cowdung/constructionplantirl.ryancouser.com/backoffice/php/PEAR/" ); set_include_path( get_include_path() . PATH_SEPARATOR . '/home/cowdung/constructionplantirl.ryancouser.com/backoffice/php/PEAR/' ); // include PEAR mail classes include('Mail.php'); include('Mail/Mime.php'); ?>

but receiving the following error

Warning: include(Mail/Mime.php) [function.include]: failed to open stream: No such file or directory in /mnt/local/home/cowdung/constructionplantirl.ryancouser.com/backoffice/send_newsletter.php on line 18

Warning: include() [function.include]: Failed opening ‘Mail/Mime.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php:/usr/local/lib/php:/home/cowdung/constructionplantirl.ryancouser.com/backoffice/php/PEAR/:/home/cowdung/constructionplantirl.ryancouser.com/backoffice/php/PEAR/’) in /mnt/local/home/cowdung/constructionplantirl.ryancouser.com/backoffice/send_newsletter.php on line 18

Hope you can help because I have spent days on this with no result.
Regards


#2

I am also having the same problem.

http://blogdir.thedarksoul.org/peartest.php

Code:
ini_set(
‘include_path’,
ini_get( ‘include_path’ ) . PATH_SEPARATOR . “/home/nievesj_blogdir/pear/php”
);

//$pear_user_config = ‘/home/nievesj_blogdir/.pearrc’;

set_include_path(
get_include_path() .
PATH_SEPARATOR . ‘/usr/local/php5/bin/php’
);

echo ini_get(‘include_path’);
echo “

”;
echo get_include_path();

require_once “Auth.php”;

// Takes three arguments: last attempted username, the authorization
// status, and the Auth object.
// We won’t use them in this simple demonstration – but you can use them
// to do neat things.
function loginFunction($username = null, $status = null, &$auth = null)
{
/*

  • Change the HTML output so that it fits to your
  • application.
    */
    echo “<form method=“post” action=“test.php”>”;
    echo “<input type=“text” name=“username”>”;
    echo “<input type=“password” name=“password”>”;
    echo “<input type=“submit”>”;
    echo “”;
    }

$options = array(
‘dsn’ => “mysql://user:password@localhost/database”,
);
$a = new Auth(“DB”, $options, “loginFunction”);

$a->start();

if ($a->checkAuth()) {
/*

  • The output of your site goes here.
    */
    }

Error:

Warning: Auth::include_once(Auth/Container/DB.php) [auth.include-once]: failed to open stream: No such file or directory in /home/.langston/nievesj_blogdir/pear/php/Auth.php on line 468

Warning: Auth::include_once() [function.include]: Failed opening ‘Auth/Container/DB.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php:/usr/local/lib/php:/home/nievesj_blogdir/pear/php:/usr/local/php5/bin/php’) in /home/.langston/nievesj_blogdir/pear/php/Auth.php on line 468

Fatal error: Class ‘Auth_Container_DB’ not found in /home/.langston/nievesj_blogdir/pear/php/Auth.php on line 469

I followed the instructions on this Wiki exactly as described and its still not working.

Any help would be MUCH appreciated.


#3

I’m still having problems getting it to work, I have asked dreamhost for help but I got this reply
"Sadly, as this is a third party application, we cant really assist you in
troubleshooting."
If I don’t get this sort soon I might need to move host to one that provides it


#4

//$pear_user_config = ‘/home/nievesj_blogdir/.pearrc’;

Have you tried moving your ini_set’s to .pearrc and uncommenting that declaration?

Maximum Cash Discount on any plan with MAXCASH


#5

No, the Wiki it doesn’t say I need to do that.


#6

Read from this section downward:

http://wiki.dreamhost.com/PEAR#Including_PEAR_modules_in_scripts

You may need to check your home/.mount/username to include in the path, and be aware that default setups are php5 now as well.

Just something to try out.

Maximum Cash Discount on any plan with MAXCASH


#7

Tried that before posting the first time, it gave me the same error. Again, I have followed every step of the Wiki and I still cant get this thing running. I dont know what I am doing wrong…, the Wiki must be flawed because I am not skipping steps.

I dont really know what else to do to get this running.


#8

It’s not flawed. The guys who supplied all that info new exactly what they were talking about, it’s probably just that they were talking about it quite some time ago and it possibly doesn’t contain information relative to your new and improved environment.

The thing about the Wiki is that some articles were written some time ago for older server versions. Dreamhost has updated as they’ve grown and as such scripts that worked copy/pasta on old compiles don’t necessarily work without a bit of tinkering (or complete rewriting) on the newer up-to-date super-you-beaut server configs.

Unfortunately this means of course we as end users can’t rely strictly on the Wiki as a one-stop shop for all our copy/pasta needs unless someone updates everything to include all configurations currently being implemented at Dreamhost. This would be a massive authoring task indeed!

To better troubleshoot your particular circumstance you might first arm yourself with as much information regarding your server setup as possible. This could start with a simple uname -a in shell or checking a phpinfo() output, but the thing is to collate as much info on your particular environment as possible. Now you have the ammo necessary, you can head out into the tech battlefield at places like http://pear.php.net and my all-time favourite “wtf m8?” resource site - Mr Google.

I’ve found Google is amazing at finding precisely what you want if you type a direct question into the search field itself. Leave out the massive keywords (like “Dreamhost”) on your second attempt if you find yourself linked back here or the Wiki the first time around.

Key points are: Environment, Module, Issue.

Maximum Cash Discount on any plan with MAXCASH