不允许PHP操作的可能原因是什么?

不允许PHP操作的可能原因是什么?,php,networking,storage,Php,Networking,Storage,接下来,我在php.ini文件中添加了路径,但仍然收到以下警告/错误消息: Warning: scandir(): open_basedir restriction in effect. File(S:\Docs) is not within the allowed path(s): (C:\inetPub;S:\Docs) in C:\inetpub\somewhere.com\cr\test.php on line 25 Warning: scandir(S:\Docs): failed

接下来,我在php.ini文件中添加了路径,但仍然收到以下警告/错误消息:

Warning: scandir(): open_basedir restriction in effect. File(S:\Docs) is not within the allowed path(s): (C:\inetPub;S:\Docs) in C:\inetpub\somewhere.com\cr\test.php on line 25

Warning: scandir(S:\Docs): failed to open dir: Operation not permitted in C:\inetpub\cr\somewhere.com\test.php on line 25

Warning: scandir(): (errno 1): Operation not permitted in C:\inetpub\somewhere.com\cr\test.php
我被告知S:/drive不在承载web文件的Microsoft IIS web服务器上,它是需要用户名和密码才能进入的Linux NAS。它已映射到Web服务器,但似乎无法通过PHP访问它。告诉我这些信息的人在网络中工作,他说这是一个路径问题,属于我的领域,但我认为这是一个许可问题,这可以追溯到他,他把访问这个驱动器的烫手山芋来回传递了一周。我们俩似乎都无法弥合这一鸿沟

PHP代码:

<?php 
 ini_set('display_errors', 1);
 ini_set('display_startup_errors', 1);
 error_reporting(E_ALL);

 $files = scandir('S:\Docs');
 var_dump($files);

 $filename = 'S:\Docs\cr\text.pdf';

 if (is_readable($filename)) {
   echo 'good';
 } else {
  echo 'bad';
 }
?>
发生这种情况的原因是什么?

检查INI文件中是否设置了“open\u basedir”,该文件指向不同的目录


基本上,open_basedir用于限制或限制目录访问。

is_readable()函数可能会告诉您是否有权访问它/它存在:@Ritesh我们在S:驱动器上的everyone组处于安全状态。除完全控制和特殊权限外,它已全部检查。因此,读、写和所有其他权限都已检查。@NanoPish更新了我的问题。@hnewbie此输出似乎意味着您对该目录没有读取权限。Try可通过'S:','S:'Docs','C:'读取,以了解当前允许读取的内容?@hnewbie好的,因此您对该磁盘/路径没有权限。您应该配置php/服务器和/或操作系统以获得访问权限。我将发布一个答案,试图给出解决方案
is_readable(): open_basedir restriction in effect. File(S:\Docs\cr\text.pdf) is not within the allowed path(s): (C:\inetPub;S:\Docs) in C:\inetpub\somewhere.com\cr\test.php on line 34