简体   繁体   English

如何更改PHP当前的脚本所有者

[英]How can I change the PHP current script owner

The Scenario: I am currently running PHP 5.5.30 on Apache 2.0 which is installed on a Windows 7 server. 方案:我当前在Windows 7服务器上安装的Apache 2.0上运行PHP 5.5.30。 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: PHP当前的脚本所有者是SYSTEM ,它当然具有本地权限,但是无法访问网络驱动器,因此我收到以下消息:

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

The Question: Is it possible to change the PHP current script owner? 问题:是否可以更改PHP当前脚本所有者? And if so, would I change this somewhere in PHP or Apache? 如果是这样,我可以在PHP或Apache的某个地方进行更改吗?

  1. Open Services in the Management Console (Start -> run -> services.msc) 在管理控制台中打开服务(开始->运行-> services.msc)
  2. Open the properties of the Apache entry. 打开Apache条目的属性。
  3. Under the tab "Log on" you can select which user the Apache process should use 在“登录”标签下,您可以选择Apache进程应使用的用户

This will affect PHP as well. 这也会影响PHP。

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. 请注意,您将必须提供该帐户的密码,并且该密码将以明文形式存储在注册表中,因此请明智地选择要在该帐户中使用的帐户。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改用户所有者,以便可以通过FTP编辑和/或删除使用PHP脚本创建的文件夹? - How can I change the user owner so a folder created with a PHP script can be edited and/or deleted through FTP? 我可以通过PHP脚本更改当前的shell目录吗? 如果是这样,怎么办? - Can I change the current shell directory from a PHP script? If so, how? 如何从脚本中获取当前的 PHP 可执行文件? - How can I get the current PHP executable from within a script? 如何在当前PHP脚本中获取所有MySQL命令? - How can I get all MySQL commands in the current PHP script? 如何使用所有者组和用户更改php上传 - How to change the php upload with owner group and user 我怎么知道哪个php页面请求当前的php脚本? - How can i know which php page request current php script? 如果我在另一页上包含php脚本,如何检测当前URL的名称? - How can I detect the name of my current URL if I include my php script on another page? 如何删除 PHP 中当前网页链接中的某些字符以获得更改语言的链接? - How can I remove some characters in the current webpage link in PHP to have a link to change language? 如何修复文件权限(和所有者/组),以便可以删除 php 上传的文件? - How can I fix file permissions (and owner/group) so that files uploaded by php can be deleted? 在PHP中,如何反序列化为当前对象? - In PHP, how can I unserialize into the current object?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM