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?
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.

McKnifeCommented:
What is B:? Did you map B: to some drive?
0
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
Yes, I've been using B: and A: as drives for years.
0
McKnifeCommented:
So what did you map b: to? "What is behind B"?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
It's a partition on a physical drive.
0
McKnifeCommented:
Could you localize the contents of "line 708"?
0
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.
0
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.
0
McKnifeCommented:
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.
0

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.
0
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.
1
Daniele BrunengoIT Consultant, Web DesignerAuthor Commented:
No, B is a physical drive. It was the antiransomware locking httpd. Now it works. Thanks.
0
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.
1
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
wamp

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.