-1

I have narrowed down my issue to the following case.

I have a simple file 'test.php'

<?php
mkdir("w:/Input/47/");
?>

When I run it from command line (php -f test.php), it successfully creates the directory.

When I run it through the windows version of Apache, I get:

[17-Dec-2012 16:29:49] PHP Warning:  mkdir(): No such file or directory in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ReportComp\test.php on line 2

I'm running Apache 2.2 (64bit) in Windows 7 (64 bit) as my domain user name (the same one I'm logged into my desktop as)

The 'w' drive is a network drive that (I believe) is also running windows.

Any thoughts?

not-bob
  • 775
  • 7
  • 21
  • 3
    As what user does apache run? Maybe apache doesnt have write permission to w: drive? p.s. when you run in console, you probably run as root ? – Glavić Dec 17 '12 at 22:39
  • Can you log in as the apache user and try to exec the file from command line again? Is drive w:/ available for the apache user? AFAIK Windows newtwork folders can be mounted on a per user or per system policy – hek2mgl Dec 17 '12 at 22:40
  • I'm running apache as the same user that I"m logged into my desktop as. – not-bob Dec 17 '12 at 22:47

1 Answers1

1

Windows uses '\' as directory separator .. possibly this could couse the issue i would sugest you to use 'DIRECTORY_SEPARATOR'

DaGhostman Dimitrov
  • 1,538
  • 17
  • 42
  • Unfortunately, that doesn't explain why this works from the command-line and not apache. However, I've tried using both '/' and '\\', both with and without trailing slashes. I have a limitation in that the same path used to create the folder is used by a 3rd party application that doesn't like UNC. – not-bob Dec 18 '12 at 16:52