Wampserver write permissions

Hello, so I'm trying to mirror some website from my LAMP server to my Windows 10 PC.
I am using WAMP server to do this but I have huge problems with permissions.

Apache can't seem to write stuff anywhere. The service runs as local system and the SYSTEM user has full control. I also tried giving EVERYONE full control, it still doesn't work. I keep getting errors like this:

Warning: error_log(../xxxxxxxxxxx/00000b015e503ae39081e38d06f1652e822b20171116.log): failed to open stream: Permission denied in B:\Siti\xxxxxxxxx\xxx.php on line 708

Open in new window

I also tried running Apache as a local administrator, still no go.

There must be a way to make this work. I have a CentOS vm on and I could use that, but it would be handier for me to go full local.
Also, I can't stand things not working.
Daniele BrunengoIT Consultant, Web DesignerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What is B:? Did you map B: to some drive?
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Yes, I've been using B: and A: as drives for years.
So what did you map b: to? "What is behind B"?
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
It's a partition on a physical drive.
Could you localize the contents of "line 708"?
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
I think the clues are in the .log file name.

Look at the filename closely. It's a relative filename, rather than absolute.

This means, wherever Apache or FPM starts up, then you'd have to arrange to create the "/xxxxxxxxxxx/" directory relative to ".." for this to work.

A recipe for disaster, as anytime your higher level (parent) directories change, then you'll have to manage their ownerships.

First start with absolute files for all your logging.

Once this works, you can (shudder) move to relative paths if you really must.

I host 100s of high traffic + high speed WordPress sites. I make all PHP + Apache + MariaDB log file paths absolute, so I never have to guess about directory paths.

Try this + see if your problem disappears.
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
You're devoting too much attention to that particular example I made. Apache (and therefore php) can't write anything anywhere on the machine. That was just an example, but I get similar errors every time there is a php write operation.

The problem is with Wamp and permissions. There are tons of threads around but nobody seems to have found a solution working for everybody.
Please download procmon from microsoft, start it and monitor the access denials. Save the filtered log (filtered for term "access denied") and upload the log.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Ok, I caught it. It was an antiransomware routine I forgot about.
Olaf DoschkeSoftware DeveloperCommented:
In regard of Everyone, look at https://weaselfire.wordpress.com/2009/07/09/everyone-isnt-everyone/

If you run Apache ass Windows Service, then it runs in Session 0, another thing to learn here: https://msdn.microsoft.com/en-us/library/windows/hardware/dn653293(v=vs.85).aspx

Session 0 is not seeing any drive mapping you do, so you can't let Apache access shares, no matter what permissions you set. So if B is created as a mapped drive letter and not really a physical drive, this won't work out. Apache/PHP might not consider B a local hard drive, as A and B are reserved for floppy drives, that might also play a role.

If you look into Services in the task manager, you should find wampapache and wampmysqld services runing as LocalSystem account.
If giving explicitly giving full permission to the Webroot folder to LocalSystem doesn't work, it fails on B:\ not visible to Session 0.

Bye, Olaf.
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
No, B is a physical drive. It was the antiransomware locking httpd. Now it works. Thanks.
Olaf DoschkeSoftware DeveloperCommented:
I started my answer before you posted the solution, so forget it.

When you run httpd.exe you run a "normal" process under your account, then the whole stuff about Session 0 and LocalSystem won't matter anyway. But I also don't see much references to that. Running Wampserver really as service still is less popular than httpd.

XAMPP also does so on Windows, simply runs httpd as normal process in your normal account.

Bye, Olaf.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.