Solved

phpmailer on bluehost

Posted on 2013-05-21
6
1,490 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 16

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 108

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 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
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.  …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now