Page 1 of 1

naming, navigating files...

Posted: Mon Aug 21, 2006 12:48 pm
by jmilane
Hello,

I get this message:

Code: Select all

Fatal error: require() [function.require]: Failed opening required './includes/phpmailer/class.phpmailer.php' (include_path='.;C:\WAMP\xampp\htdocs\drupal\modules\civicrm;C:\WAMP\xampp\htdocs\drupal\modules\civicrm\packages;.;C:\WAMP\xampp\php\pear\') in C:\WAMP\xampp\htdocs\drupal\modules\civicrm\CRM\Profile\Form\Edit.php on line 55
And I know that means that this script cannot find the class.phpmailer.php file. Okay.

It looks for the file based on the include path, right?

So I need to change the include path?

Or can I reference the absolute path of phpmailer.php?

Thing is, I cant even tell you what the absolute path is. The properties of the file only say that it is in /includes... so I cant really get the absolute path.

This script that is looking for phpmailer.php is at 127.0.0.1/drupal/file.php

Argh!

Thank you...

Is there an easier way to do this? I dont know what

Code: Select all

"../"
or

Code: Select all

."/
means before filenames... it seems like sometimes the period is inside quotes and sometimes it is outside quotes...

Posted: Mon Aug 21, 2006 12:55 pm
by feyd
.. = parent directory
. = this directory
What "." is initially can be found by getcwd(). $_SERVER['DOCUMENT_ROOT'] may be illuminating.

..and yes, an absolute path is the first line of acceptance. Relative paths run through the include path.

Posted: Mon Aug 21, 2006 12:55 pm
by daedalus__
A relative path is would be something like "/includes/file.inc.php". It is relative to the current working directory.

An absolute path would be something like "C:\httpdocs\site_name\includes\file.inc.php".

"." refers to the current working directory and you probably don't need to use it.
".." refers to the parent directory of the current working directory.

Try

Code: Select all

require('includes/phpmailer/class.phpmailer.php');
EDIT: You beat me feyd. :P

Posted: Mon Aug 21, 2006 1:04 pm
by jmilane
Daedalus- wrote:A relative path is would be something like "/includes/file.inc.php". It is relative to the current working directory.

An absolute path would be something like "C:\httpdocs\site_name\includes\file.inc.php".

"." refers to the current working directory and you probably don't need to use it.
".." refers to the parent directory of the current working directory.

Try

Code: Select all

require('includes/phpmailer/class.phpmailer.php');
EDIT: You beat me feyd. :P
Thanks Feyd... I appreciate the info.

I get this now:

Code: Select all

Fatal error: require() [function.require]: Failed opening required 'includes/phpmailer/class.phpmailer.php' (include_path='.;C:\WAMP\xampp\htdocs\drupal\modules\civicrm;C:\WAMP\xampp\htdocs\drupal\modules\civicrm\packages;.;C:\WAMP\xampp\php\pear\') in C:\WAMP\xampp\htdocs\drupal\modules\civicrm\CRM\Profile\Form\Edit.php on line 55
I just cant find phpmailer.php

I know I have it though... it works elsewhere.

Posted: Mon Aug 21, 2006 1:07 pm
by jmilane
So I just copied phpmailer.php and pasted it into the path.

Bad idea?

8O

Posted: Mon Aug 21, 2006 1:19 pm
by daedalus__
What do you mean pasted it into the path?

Posted: Mon Aug 21, 2006 9:28 pm
by jmilane
Daedalus- wrote:What do you mean pasted it into the path?
I mean I went and found the file and put it into the path where it could be found.

I cant really figure out how to change the path so that it finds the file.

Is this a bad idea?

I know this sounds stupid... but Im psyched that it works.