pear path for bluehost subhost

I've been told by one bluehost tech support person that the path to pear for my subhost is:

/usr/share/pear/

but that just gives me a blank page after i submit my form, no errors.

I'm running a script called fpdf that turns form submissions into pdfs. I've beeen using it for years. On the previous server the path to pear was something like:

usr/home/php4/lib/pear/PEAR.PHP

my latest halfbaked idea is this (which doesn't work)

require_once('/usr/share/pear/pear.php');
phillystyle123Asked:
Who is Participating?
 
phillystyle123Connect With a Mentor Author Commented:
Hi All - thanks so much for your help with this! I solved this yesterday with a few tweaks.

First, the path to pear in Bluehost:

- adjusted in the php.ini file I created and placed in the site root
include_path = ".:/usr/lib64/php:/usr/lib/php:/home/username/php"

- adjusted path to pear in two files related to Mail_Mime (which I just installed in my site root - although it is an option to install Mail_Mime via your cpanel in bluehost)
fpdf/Mail.php
require_once '/home/username/php/PEAR.php';
fpdf/Mail_Mime/mime.php
require_once ''/home/username/php/PEAR.php';

After that I discovered that during the site migration the email address I was using in the $from variable no longer existed - so I updated the email address to a valid one:

// email address of the sender
$from = "validemailaddress@mysite.com";

Then it worked! I didn't have to upgrade to the very latest version of fpdf - although I did try that, but it was too much  of a headache for something that was already taking way to long.

Summary for using fpdf with the Mail_Mime class - adjust your path to Pear.php and make sure you're using a valid email address in $from.

This script currently sends an email with a pdf attachment when a form is submitted.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
PEAR stands for "PHP Extension and Application Repository" http://pear.php.net/ .  I don't know what you were expecting but in general, there are just add-ons to PHP in PEAR, not display pages.
0
 
Ray PaseurConnect With a Mentor Commented:
Do you have a cPanel (or similar) or FTP access to the server?  If so you should be able to discern the directory structure and find the repository.

Also, in the unlikely case that your hosting company has given you a PHP4 installation, you may want to ask them to upgrade your account to PHP 5.  PHP 5.4 is current.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
phillystyle123Author Commented:
Hmm - I wonder why the code I've been running for fpdf uses /pear.php at the end of the path?
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
A PEAR install on this Windows machine has PEAR.php (note the capitals) but the install on my Linux machine does not.  PEAR.php appears to be class definitions for other PEAR functions.
0
 
phillystyle123Author Commented:
this was a unix machine - but can you explain:

PEAR.php appears to be class definitions for other PEAR functions.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
See for yourself.
PEAR.php
0
 
Ray PaseurConnect With a Mentor Commented:
... the code I've been running for fpdf uses /pear.php
I've never seen that.  I've used FPDF extensively and never installed PEAR on any of the servers.  It sounds strange to me.  Maybe you would do well to remove FPDF and re-install it from a fresh download.
0
 
phillystyle123Author Commented:
I might try that Ray  -Dave

require_once('/home3/midlang4/public_html/fpdf/pear.php');

I'm getting these errors:

Notice: Only variable references should be returned by reference in /home3/midlang4/public_html/fpdf/Mail_Mime/mime.php on line 356

Warning: Cannot modify header information - headers already sent by (output started at /home3/midlang4/public_html/fpdf/Mail_Mime/mime.php:356) in /home3/midlang4/public_html/follow-up/formpdf.php on line 950
0
 
Ray PaseurConnect With a Mentor Commented:
The first is not an error -- it's a Notice.  What level of PHP are you running?  You may be able to suppress this Notice.

The second is not an error -- it's a Warning.  It occurs because the first Notice created browser output.  You might be able to solve the problem here by using ob_start() to collect the browser output and suppress it until the script ends.  A sidebar advantage of ob_start() is that your scripts will run a bit faster.

But something else seems out of whack here.  In my instance of FPDF, I do not have any character string that matches Mail_Mime.
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
I just downloaded the current version of FPDF and there is no Mail_Mime directory included with it.  It is a PEAR Package  http://pear.php.net/package/Mail_Mime/redirected that someone has added.
0
 
phillystyle123Author Commented:
Well, this just keeps getting worse. Now I can't generate an error. My script redirects to my thank you page but I don't receive the email (I'm using Mail_Mime to receive email with pdf attachment) in addition to Pear. So, no error, the fpdf script redirects me to my thank you page but I'm not receiving my email. (It's not in spam either).
0
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
According to the link above, Mail_Mime is used to create and send email, not receive it.  There is no reason to think that Mail_Mime is installed on your current host.  Here http://pear.php.net/manual/en/installation.shared.php are some instructions for installing your own copy of PEAR so you can then install PEAR packages like Mail_Mime.  I have never tried this so I don't know how difficult it is.
0
 
Ray PaseurConnect With a Mentor Commented:
...the fpdf script redirects me...
There must be a lot more to the fpdf script than meets the eye!  The FPDF class that I have used does not include redirects, so it appears that maybe someone has extended the class with local code.  Who worked on this script last?
0
 
phillystyle123Author Commented:
Thanks for the help! The reason I'm using my own answer as the best solution is because it is -in this particular instance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.