Page 1 of 1

include_once problem

Posted: Tue Oct 03, 2006 4:29 am
by thedarkdestroyer
I have downloaded an example script from a company that I use. I have installed openssl and curl as specified but when i run their example scripts I get the following errors:

Warning: include_once(/EsendexAccountService.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\Esendex\Example Files\EsendexAccountServiceExample.php on line 3

Warning: include_once() [function.include]: Failed opening '/EsendexAccountService.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Group\Apache2\htdocs\Esendex\Example Files\EsendexAccountServiceExample.php on line 3

Fatal error: Class 'EsendexAccountService' not found in C:\Program Files\Apache Group\Apache2\htdocs\Esendex\Example Files\EsendexAccountServiceExample.php on line 11

I know the file is definatley there.

I havent had a great deal of experience with include_once or with the $accountService commands so I am probably doing something stupid.
Here is the script i am using, any help would be great, thanks.

Code: Select all

<?php

include_once ('/EsendexAccountService.php');

//Test Variables:
$username = 'someusername';		//Your Username (normally an email address)
$password = 'password';			//Your Password
$account = '1234567';			//Your Account Reference (either your virtual mobile number, or EX account number)

//instantiate the service with login credentials
$accountService = new EsendexAccountService($username, $password, $account);

//get the message limit for the account
print_r ( $accountService->GetMessageLimit() );
?>

Posted: Tue Oct 03, 2006 4:33 am
by volka
include_once ('/EsendexAccountService.php');
/ stands for "root directory". Sure you want to include /EsendexAccountService.php?

What does

Code: Select all

echo 'file: ', __FILLE__, "<br />\n";
include_once ('/EsendexAccountService.php');

//Test Variables:
$username = 'someusername';          //Your Username (normally an email address)
$password = 'password';   //Your Password
$account = '1234567';         //
//...
print?

Posted: Tue Oct 03, 2006 4:36 am
by thedarkdestroyer
When you say root directory do you mean C:\ or do u mean the www or htdocs folder?

PS where did you get the

Code: Select all

echo 'file: ', __FILLE__, "<br />\n";
from???? it dosent exist on my code that I posted??

cheers

Posted: Tue Oct 03, 2006 4:39 am
by volka
sorry, typo
__FILE__, see http://www.php.net/manual/en/language.c ... efined.php

thedarkdestroyer wrote:When you say root directory do you mean C:\ or do u mean the www or htdocs folder?
ah, a win32 system. Yes, root of the current drive, C:\ or D:\ or E:\ or .....
On a unix-like system there is a single root directory, root of all the other files and directories, no drives.

Posted: Tue Oct 03, 2006 4:54 am
by thedarkdestroyer
But i dont see:

__FILE__,


anywhere in my code???

Sorry if I am being a bit thick here!!!!!

Posted: Tue Oct 03, 2006 5:01 am
by volka