[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

phpmailer on bluehost

Posted on 2013-05-21
6
Medium Priority
?
1,990 Views
Last Modified: 2013-05-21
I'm moving a basic form to email script to a new Bluehost account (Apache).  The script uses phpmailer.  The code to call the script is...

require("class.phpmailer.php");
$mail = new PHPMailer();

I'm getting the following error on the 'class.phpmailer.php' line...

Fatal error: require() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='.:/xxx/xxx/php:/xxx/lib/php:/xxx/share/pear') in /xxx/xxx/xxx/xxxxx/apply/city-signup-code.php on line 101

It looks to me like it can't find class.phpmailer.php.  I called Bluehost tech and they couldn't help me unless I could tell them what phpmailer requires.  Since the script just worked on the previous webhost, I couldn't tell them.

Any ideas are greatly appreciated.

Thanks,

Steve
0
Comment
Question by:stkoontz
6 Comments
 
LVL 17

Assisted Solution

by:Chris Harte
Chris Harte earned 664 total points
ID: 39184370
The require failed because it could not find the file 'class.phpmailer.php'. It does not matter what phpmailer() does or does not 'require' because the file containing the class is unreachable. New host, I am going to guess this is a permissions or path problem. Tell tech support to stop asking dumb questions and check the permissions on the file and that the path to the flle is correct.
0
 
LVL 2

Author Comment

by:stkoontz
ID: 39184427
Thanks for the quick response.  

That's what I was thinking.  I put in a support ticket so should hear back by tomorrow.
0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 668 total points
ID: 39184517
>>The script uses phpmailer
Let's say that The script is located at /var/www/html/the_script.php.  In order for require("class.phpmailer.php"); to work, then you also need to have "class.phpmailer.php" in the same directory/folder as "the_script.php".  Do you?

If not, you have to specify the correct path to "class.phpmailer.php".  For instance, if it is located in /var/www/html/includes/classes/classphpmailer.php, then try providing the absolute path:
require('/var/www/html/includes/classes/classphpmailer.php');
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39184625
This function may be helpful as you try to track down the correct directory path.
http://php.net/manual/en/function.getcwd.php

See also:
http://php.net/manual/en/function.phpinfo.php
0
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 668 total points
ID: 39185169
Why don't you download a fresh copy of PHPMailer and upload the file to where it needs to be?  http://code.google.com/a/apache-extras.org/p/phpmailer/wiki/PHPMailer
0
 
LVL 2

Author Closing Comment

by:stkoontz
ID: 39185624
Thanks for the help.  I downloaded a copy of PHPMailer, uploaded it to my server, and directed the path to the file and it's working now.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question