0

I'm going crazy over one problem, have been trying to fix it for very long and yet, no product.

I'm using Windows 7,PHP,Apache(Can't really do anything with apache, haven't needed yet)

I'm trying to simply make a folder and as said in the name of this thread I'm getting permission problems. The code:

mkdir("\memberFiles\$id");

What I've tried:

  • Giving all permissions to memberFiles and his parent
  • Setting full path to memberFiles which was C:\Apache24\htdocs\php_includes\memberFiles\$id
  • Look for information about this problem on google/stackoverflow but 80% of people are using linux/ubuntu/etc...

Fixing this problem would be the best thing in this week

Donny
  • 47
  • 1
  • 8
  • By all permissions, did you try giving Everyone all permissions or just 1 user? Try it with Everyone. – Jack M. Jul 08 '14 at 20:56
  • I gave permission to these users: Authenticated Users,SYSTEM,Administrators(...\Administrators),Useres(...\Users),There are no other users. – Donny Jul 08 '14 at 20:59
  • maybe a variant of an answer below, use \\ instead of \ ? – Jack M. Jul 08 '14 at 21:09
  • possible duplicate of [PHP:mkdir() permission denied](http://stackoverflow.com/questions/24627939/phpmkdir-permission-denied) – Johann Bauer Jul 09 '14 at 07:03

1 Answers1

1

I don't think you've got a permission problem.

You are using Backslashes for the path but that would just escape the next character.

If you want to create the folder in the current directory use:

mkdir('./memberFiles/$id');

If you really want to create it in the root directory of the current drive (eg. C:), use:

mkdir('/memberFiles/$id');

If it would really be a permission problem, it would throw a warning:

PHP Warning:  mkdir(): Permission denied in ... on line ...
Johann Bauer
  • 2,488
  • 2
  • 26
  • 41
  • I've made it your way, "mkdir('./memberFiles/$id');" now I'm getting another error: Warning: mkdir() [function.mkdir]: No such file or directory in... – Donny Jul 08 '14 at 21:07
  • That's because it could not create ``memberFiles``. You do have a permission problem now. – Johann Bauer Jul 08 '14 at 21:09
  • I already have created folder memberFiles and gave it all permissions. also,the full warning looks like this: Warning: mkdir() [function.mkdir]: Permission denied in /home/diligenceh/domains/diligencehelps.com/public_html/php_includes/form_check.php on line 30 – Donny Jul 08 '14 at 21:13
  • That is no Windows file-path. It looks like a Linux server. – Johann Bauer Jul 08 '14 at 21:16
  • The server on diligencehelps.com is running Linux. Ask your hosting-provider for advice and don't make up facts in your question. – Johann Bauer Jul 08 '14 at 21:20