1

The Scenario: I am currently running PHP 5.5.30 on Apache 2.0 which is installed on a Windows 7 server. The PHP current script owner is SYSTEM which of course has local powers but does not have access to network drives and so I am receiving the following message:

scandir(\\\MyFolder,\\MyDrive\MyFolder): Access is denied. (code: 5)

The Question: Is it possible to change the PHP current script owner? And if so, would I change this somewhere in PHP or Apache?

Pigeon
  • 62
  • 9

1 Answers1

0
  1. Open Services in the Management Console (Start -> run -> services.msc)
  2. Open the properties of the Apache entry.
  3. Under the tab "Log on" you can select which user the Apache process should use

This will affect PHP as well.

Note that you will have to provide the password to the account and that it will be stored in clear text in the registry, so choose wisely which account you want to use there.

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78
  • One more note, just to clarify things. File itself doesn't have any permissions. It may belong to some user or group of users, but it doesn't affect what can do script with certain owner. This ownership and permissions decide what certain user can do with this file. – Andrew Dec 01 '15 at 14:45
  • Give Gerald Schneider a gold star! This way I can also create a new user for the Apache server that only has read permissions in order to increase security! Thank you very much sir. – Pigeon Dec 01 '15 at 14:59