tabasca Posted July 7, 2010 Share Posted July 7, 2010 hi everybody here, I need some help from an expert. So, I created a website for my company. I want to list a network directory using php script. I use opendir() function but no way. I received a Warning message telling that the result was to large !!! I tryed several combination of "//" and "\\" and the pb still . please help if any :'( thks Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/ Share on other sites More sharing options...
kenrbnsn Posted July 7, 2010 Share Posted July 7, 2010 Please post your code and the exact error message. Ken Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1082475 Share on other sites More sharing options...
tabasca Posted July 7, 2010 Author Share Posted July 7, 2010 Thks Ken, I forget my config: - IIS server / Win XP - PHP / Mysql the network drive has <Z:> as identif. bat the full path is \\maxserver\mydir Opendir() workd fine with local drives but not with <z:> Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1082478 Share on other sites More sharing options...
kenrbnsn Posted July 7, 2010 Share Posted July 7, 2010 Please post your code and the exact error message. Without seeing these, we can't give you an answer. Ken Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1082482 Share on other sites More sharing options...
tabasca Posted July 11, 2010 Author Share Posted July 11, 2010 Hi, this is my code : <?php function open_dir ($dir_name) { if ($handle = opendir ($dir_name)) { while (($file = readdir($handle)) != false) { if ($file != '.' && $file != '..') if (filetype($dir_name.'/'.$file)== 'dir') { open_dir ($dir_name.'/'.$file); } else { echo "----- ".$dir_name.'/'.$file."<br>"; } } closedir($handle); } } error_reporting(E_ALL); ini_set('display_errors', '1'); //$rep = "c:"; // work fine with this declaration //$rep = "////MyNetworkDrive/Diretory01/"; // dosn't work (see message error) $rep="\\\localhost\\web"; // dosn't work (see message error) open_dir($rep); ?> Error message : Warning: opendir(//localhost/web) [function.opendir]: failed to open dir: Result too large in D:\MySites\tpoe\web\dir.php on line 5 Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1084317 Share on other sites More sharing options...
tabasca Posted July 11, 2010 Author Share Posted July 11, 2010 Still nothing yet !!! Any idea ??? Any solution ??? Please Help ! Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1084504 Share on other sites More sharing options...
kenrbnsn Posted July 11, 2010 Share Posted July 11, 2010 The problem might be that the drive is not mapped for the process that's running the webserver. Take a look at this thread in another forum. Ken Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1084574 Share on other sites More sharing options...
Pikachu2000 Posted July 12, 2010 Share Posted July 12, 2010 The slash escaping doesn't look right on the ones that aren't working. If that doesn't help, I don't know what else to suggest. //$rep = "c:"; // work fine with this declaration //$rep = "////MyNetworkDrive/Diretory01/"; // try //MyNetworkDrive/Directory/01/ $rep="\\\localhost\\web"; // try \\\\localhost\\web\\ Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1084697 Share on other sites More sharing options...
tabasca Posted July 12, 2010 Author Share Posted July 12, 2010 hi guys, I've tryed what you told me. system("net use O: \\\MyNetworkDrive/Diretory mypass/user:myid /persistent:no>nul 2>&1, $rep"); open_dir($rep); And actually, I tart receiving this message : Warning: system() [function.system]: Unable to fork [net use O: \\MyNetworkDrive/Diretory mypass/user:myid /persistent:no>nul 2>&1] in D:\MySites\tpoe.ort\web\dir.php on line 43 Warning: opendir(-1) [function.opendir]: failed to open dir: No error in D:\MySites\tpoe.ort\web\dir.php on line 5 I want to know the meaning of this warning messages and if there is any solution / Thanks Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1084787 Share on other sites More sharing options...
tabasca Posted July 13, 2010 Author Share Posted July 13, 2010 Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1085525 Share on other sites More sharing options...
tabasca Posted July 17, 2010 Author Share Posted July 17, 2010 hi, Is there any suggestion??!! Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1087572 Share on other sites More sharing options...
Zane Posted July 17, 2010 Share Posted July 17, 2010 This should be of some use to you. PS. I found it with Google using the search term "Unable to fork"; and it was the first one on the list http://www.somacon.com/p255.php A quote from the page In Windows, when trying to execute a system call from a PHP script, you receive a warning like "Warning: system() [function.system]: Unable to fork". A related warning message is "Warning: shell_exec() [function.shell-exec]: Unable to execute" Cause The most likely cause is insufficient permissions to execute system calls in the web server environment. Fix You need to give the Internet Guest Account (a.k.a. IUSR_MachineName or simply IUSR) read and execute permission to the command shell program, cmd.exe. Typically, permission to this file is explicitly denied as a security measure. Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1087592 Share on other sites More sharing options...
tabasca Posted July 18, 2010 Author Share Posted July 18, 2010 Thks a lot Zanus, may be the solution of this issue . I will try. Quote Link to comment https://forums.phpfreaks.com/topic/207012-opendirnetworkdrivefolder/#findComment-1087705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.