Forum Moderators: coopster

Message Too Old, No Replies

Path question with Windows and PHP

         

wavesurf

4:56 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



Could anyone give an example of how to use paths in a PHP-script on a Windows server.

I have a location that is like this:

c:\Inetpub\wwwroot\website\exampledirectory\

Localhost is at: c:\Inetpub\wwwroot\

At the exampledirectory location I would like to create directories and upload files. I think I have the correct permissions, but I can't seem to get it to work. So I'm thinking maybe my paths are wrong. Could someone please tell me how I could use for example mkdir(string pathname) to get this to work.

Thanks.

coopster

7:15 pm on Nov 21, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I would use the slash (/) character. According to the PHP Manual [php.net]:

On Windows, both slash (/) and backslash (\) are used as path separator character. In other environments, it is the forward slash (/).

What is the permissions on the directory you are trying to upload to? Use the umask function [php.net] to determine this:


<?php
echo umask();
?>

Place this script in the directory you mentioned:
c:\Inetpub\wwwroot\website\exampledirectory\

wavesurf

11:48 am on Nov 26, 2003 (gmt 0)

10+ Year Member



I think I figured out what needed to be done. The permissions that I had problems with was in the actual destination directory, which I though were where it should be, but it seemed like the permissions had to be changed in the directory where the script runs as well.

So I have made it work.

Thanks for your tip. It was put me in the road to salvation :)