Solved

phpmailer on bluehost

Posted on 2013-05-21
6
1,653 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 166 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 167 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 110

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 83

Accepted Solution

by:
Dave Baldwin earned 167 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 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