0

I have a fairly new server (couple months old) where I've got IIS and PHP running with FASTCGI.

Anyways, I have a script in C:\inetpub\wwwroot\webservice_read_scripts\ that needs to go do a require_once on the phpmailer library in C:\inetpub\wwwroot\phpmailer.

I know I shouldn't use absolute URL's but I've been trying both absolute and relative and they just aren't working.

I have the absolute one in place right now: require_once("C:\inetpub\wwwroot\phpmailer\class.phpmailer.php")

In an attempt to get this to work, I've also tried, just ahead of this line... the following, in order to try to force the right directory to be set as the "include path":

chdir("..")
chdir("phpmailer")
set_include_path(getcwd());

And I'm getting the following two errors:

Warning: require_once(1): failed to open stream:  No such file or directory in (gives path to my executing script and refers to that require_once line)

Fatal error: require_once(): Failed opening required '1' (include_path="C:\inetpub\wwwroot\phpmailer") in (gives path to my script and that require_once line again)

The file IS there and is named correctly.

I figure it must be permissions? I've got... "Users" and "IIS_USRS" groups set up for Read and Execute access. There's a domain-level group named "IUSR" that I've set to full control too.

Not sure what to do next, as googling isn't finding me much more. Any thoughts??

DaveyBoy
  • 435
  • 4
  • 20
  • I just tried creating an includes directory under the PHP folder and then setting my php.ini so that the includes directory. Cycled IIS. Commented out my "set_include_path" line above... changed the require_once to require_once("class.phpmailer.php") and basically got the same errors (only change was the include path reported). – DaveyBoy Mar 26 '14 at 15:08
  • 1
    Just changed it to this and I think that's done the trick!: require_once("/../phpmailer/class.phpmailer.php"); Not sure why forward slashed worked, but backwards slashes didn't. – DaveyBoy Mar 26 '14 at 16:00
  • One often runs into this error, and to quickly troubleshoot it, follow these steps : http://stackoverflow.com/a/36577021/2873507 – Vic Seedoubleyew Apr 12 '16 at 16:46

0 Answers0