?
Solved

phpmailer on bluehost

Posted on 2013-05-21
6
Medium Priority
?
1,847 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

764 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