[英]Download Wamp onto a Shared Drive so everyone in school can access HTML and PHP pages
[英]PHP in WAMP can not access mapped drive
相對:
我知道這是非常老派,但我無法弄明白......
在帶有wamp的Windows 2003(apache 2.2,PHP 5.3.10)上作為服務運行。 按照上面的鏈接,我已經讓它以Administrator
身份而不是SYSTEM
身份運行。 但仍然沒有運氣。
我制作了一個.bat
文件來說清楚:
@echo off
whoami
net use
php -r "var_dump(scandir('Z:\\'));"
php -r "var_dump(scandir('\\\\192.168.211.86\\voice'));"
php -r "var_dump(scandir('//192.168.211.86/voice'));"
如果我在cmd
運行它,結果是:
serv2003\administrator
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
OK R: \\192.168.211.86\voice Microsoft Windows Network
OK Z: \\192.168.211.86\voice Microsoft Windows Network
The command completed successfully.
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
array(5) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(6) "Folder"
}
但是如果我在Apache中運行它:
<body><pre>
<?php
echo `C:\path\to\test.bat`;
?>
</pre></body>
它輸出:
serv2003\administrator
New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
Unavailable Z: \\192.168.211.86\voice Microsoft Windows Network
The command completed successfully.
Warning: scandir(Z:\): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
Warning: scandir(\\192.168.211.86\voice): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
Warning: scandir(//192.168.211.86/voice): failed to open dir: No such file or directory in Command line code on line 1
Warning: scandir(): (errno 2): No such file or directory in Command line code on line 1
bool(false)
請注意,是的,在Apache模塊中有一個R:
驅動缺失,但由於我正在訪問Z:
我認為這不是問題所在。
我無法訪問遠程文件夾,也無法將所有文件復制到本地系統。 我只需要能夠在PHP中讀取它們。 我能做什么?
提前致謝!
編輯1 :
不確定這是否重要,但我通過遠程桌面訪問此服務器(它在地理上遠離我)。
並且\\\\192.168.211.86\\voice
使用用戶名/密碼進行映射。
以上所有練習都在同一個登錄會話中運行。
嘗試手動安裝Apache,PHP和MySQL。 當我嘗試使用Curl(在PHP CLI模式下)運行代碼時,我對WAMP非常頭痛,並且花了幾天時間來研究問題是什么,從那天起我就不會在任何測試環境中安裝預捆綁包。
此鏈接將指導您: http : //docs.joomla.org/Setting_up_Apache,_PHP_and_MySQL_manually
檢查服務器防火牆。
設置所有服務是不必要的。 問題是使用wamp和apache,當你使用網絡驅動器時,apache無法啟動,wamp的顏色在這種情況下通常是黃色,或者apache會出錯。 要確保用cmd行打開httpd.exe。 你會看到一個錯誤“驅動器無法找到,apache無法啟動等” 畢竟它可能是你意識到問題是wap上的apache無法作為服務啟動。 本文檔將為您提供幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.