首页 \ 问答 \ PHP和权限(PHP & Permissions)

PHP和权限(PHP & Permissions)

我有一个应用程序,我正在转移到一个新的服务器。 在这样做时,客户帐户的上传功能停止工作,因为文件夹的所有者是'ftp'而不是'apache'我通过重命名文件夹然后使用我复制并粘贴到某个地方的目录复制功能来解决它具有正确名称的新文件夹,之后就很酷了。

我的问题是,php可以更改文件夹或文件的所有权吗?


I have an application that I am transferring to a new server. In doing so the upload feature for customers accounts stopped working because the owner of the folders was 'ftp' and not 'apache' I solved it by renaming the folder and then using a directory copy function that I copied and pasted from somewhere in to a new folder with the correct name and it was all cool after that.

My question is this, can php change the ownership of a folder or files?


原文:https://stackoverflow.com/questions/7493385
更新时间:2022-04-02 20:04

最满意答案

如果您正在运行Windows 7或更新版本(或基于此的任何内容),则可以使用AppLocker功能:

http://technet.microsoft.com/en-us/library/dd723686(v=ws.10).aspx


If you are running Windows 7 or newer (or anything based on it), then you can use the AppLocker feature:

http://technet.microsoft.com/en-us/library/dd723686(v=ws.10).aspx

相关问答

更多
  • 实际上,Run()会同步启动目标,因此在下一行PowerScript运行时,Run()应用程序可能无法完成,更不用说有可用的返回代码了。 您需要自己使用合适的参数进行Windows API调用才能实现此目的,而不是依赖于PowerScript包装器,而该包装器只提供同步选项。 以下是我必须启动DOS命令并获取返回值的内容。 您可能需要也可能不需要根据需要调整API调用的参数。 API调用假定为PowerBuilder的Unicode版本,即10.0或更高版本。 External Function Proto ...
  • 您应该始终重命名用户上传的文件! 如果您不这样做,用户可以轻松上传hack.php ,然后启动它以使您的网站被黑客攻击或滥用。 所以这实际上是你的问题。 上传后重命名文件。 在数据库中保留原始名称(以及大小,mime类型等)并通过脚本路由文件下载/视图,该脚本将从DB获取该原始名称并构建适当的头文件,然后将该文件的file()内容发送给用户。 这样可以防止文件在您的服务器上执行 或者,如果这只是.htaccess的问题(但我敢说它更宽),那么你可以配置apache忽略某些目录中的.htaccess。 它需要 ...
  • 对于评论来说这有点太长了,但我没有测试这种方法,你可能需要调整它。 文档说,组件按照它们创建的相反顺序销毁。 这意味着您可以在ActorSystem关闭之前取消您的调度程序,因为此类在它之后注册并依赖于它。 在OnStartup类中创建一个这样的关闭钩子,在这个类中你将取消你的日程安排。 这意味着在ActorSystem关闭时,将没有执行计划: @Singleton public class OnStartup { private final Cancellable cancellableSche ...
  • 它们不仅具有优先级4,它们还具有左关联性。 这是in in infixl ; 一个人也可以选择infixr用于权利关联,而中infix用于“如果你需要知道关联性应该是什么就会抛出错误”。 从而 Three' x <$> f y <*> f z 被解析为: (Three' x <$> f y) <*> f z 至于首先执行哪一项,如果没有看到你要问的(<*>)的实现,就无法回答; Three' x <$> fy将被评估得足以让(<*>)像往常一样取得进展,所以如果(<*>)可以在不首先评估(<$>)调用的 ...
  • 如果您正在运行Windows 7或更新版本(或基于此的任何内容),则可以使用AppLocker功能: http://technet.microsoft.com/en-us/library/dd723686(v=ws.10).aspx If you are running Windows 7 or newer (or anything based on it), then you can use the AppLocker feature: http://technet.microsoft.com/en-us ...
  • 大多数命令行应用程序设置退出代码以指示成功或失败。 你这样测试它: p.WaitForExit(); if (p.ExitCode == 0) { // Success } else { // Failure } Most command-line applications set an exit code to indicate success or failure. You test it thus: p.WaitForExit(); if (p.ExitCode == 0) { ...
  • 我无法理解if(arguments.length == 1)的Else条件何时执行,因为funktion总是被setReloadTime(5)调用,这意味着它将是真实的 不,代码设置一个计时器来运行它,没有任何参数: reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs) * 1000)); // Here -----------------^^^^^^^^^^^^^^^^^ 这就是为什么它在第一次通话后采取了这个分支。 ...
  • 在Sql Server中,您有一个名为Profiler的工具(尽管不是快速版本)。 转到Management Studio,工具菜单,应该有“Sql Profiler”。 它作为一个单独的应用程序运行。 启动时,为其提供与要监视的数据库服务器的连接。 您可以监控各种各样的事情,但很可能您只想过滤数据库并查看查询: 转到事件选择 选中“显示所有列” 打开“列过滤器” 在筛选器列表中输入您的数据库名称,以及您可能感兴趣的任何其他内容(通常,默认设置正常) 现在,当您单击“运行”时,跟踪正在运行。 暂停它,将代码 ...
  • 您可以使用以下行将.htaccess放入上传文件夹中: php_flag engine off 它将禁用此目录中的PHP执行。 编辑回答评论: chmod 666不会阻止PHP执行。 它只是将文件标记为不可执行,因此您无法直接将它们作为脚本或二进制文件运行。 PHP不关心文件的权限,只要它是可读的,它就会被引擎解析和执行。 因此,如果您的服务器有多个引擎(PHP,Jelly等),您将不得不手动构建一个配置文件,以防止文件夹中的文件被解释。 您可以创建一个脚本,根据计算机上安装的引擎生成该文件。 You ca ...
  • 您可以将应用分开,让他们通过以下方式沟通: 1.每个工人都要听不同的队列 $ celery worker -Q feeds 2.使用某种路由方法向特定应用发送消息,来自docs的手动示例: >>> from feeds.tasks import import_feed >>> import_feed.apply_async(args=['http://cnn.com/rss'], ... queue='feed_tasks', ... ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。