誰かがIIS7のPHPFastCGIのExtJS4で必要な構成(またはトラブルシューティング)ファイルのアップロードを手伝ってくれますか?アプリケーションのユーザーインターフェイスは正常に機能していますが、ファイルが\file_upload\public\tmp\upload
フォルダーに移動していません。
より詳しく:
過去数日間、ExtJS 4用のさまざまなマルチファイルアップロードウィジェットを試してきました。一部は新しいHTML5ファイルAPIでのみ機能しますが、InternetExplorerでは機能しません。また、ExtJS 4とうまく調和しないユーザーインターフェイスを備えているものもあるので、少し間抜けに見えると思いました。非常にシンプルですが、ようやくすべてのブラウザで動作するものを見つけました。PHPFastCGIを使用するIIS7上のWindowsServer2008で、以下のExtJS / PHP複数ファイルアップロードアプリケーション(ブログリンク)を構成しました。セットアップについていくつか説明があります。アプリケーションのユーザーインターフェイスを機能させるための構成とその他のいくつかのことを除いて、アプリケーションでは実際には何も変更していません。
Windowsのセットアップ手順:
1.)ここにあるウィジェット:
http://blog.debug.cz/2012/05/file-upload-widget-for-extjs-4x.html
デモは次のとおりです。
ここGitHubでソースをダウンロードします:
https://github.com/ivan-novakov/extjs-upload-widget
2.)抽出したファイルをデスクトップに配置し、簡単にするためにルートフォルダの名前を「file_upload」に変更します
3.)ExtJS 4をダウンロードし、ルートExtJS 4フォルダーの名前を「extjs」に変更して、このフォルダーに配置します。
\file_upload\public\[extjs]
これをダウンロードして抽出します。
http://cdn.sencha.io/ext-4.1.0-gpl.zip
4。)(Windowsの場合)「upload」ショートカットファイルの名前を「upload_old」に変更し(または単に削除し)、実際のアップロードフォルダー\file_upload\lib\upload
をフォルダーにコピーします。\file_upload\public\external\upload
5.)\file_upload\public\tmp\upload
PHPファイルのファイルアップロードフォルダを作成して、そのファイルを配置します
define('UPLOAD_DIR', '/tmp/upload/');
6.)IIS7のWindowsServer 2008(x64)でPHPをセットアップする
WindowsServer2008のIIS7でCGIをオンにしました
IIS 7.0(x64)用の管理パックをダウンロードしました
次の指示に従いました。
http://www.howtogeek.com/50432/how-to-install-php-on-iis-7-for-windows-server-2008/
これらのphp.ini設定を使用しました:
cgi.force_redirect = 0
fastcgi.impersonate = 1
extension_dir = "D:\Program Files\php\ext"
date.timezone = "America/Chicago"
extension=php_curl.dll"
display_errors = On ==========> more notes below
upload_tmp_dir = "{desktop path}\file_upload\public\tmp\upload"
7.)IIS 7に明らかに問題があるため、phpファイルの先頭に配置しました。
<?PHP
ini_set('display_errors',true);
8.)ここで回答に従って、IIS 7forPHPでHTTPエラーを構成します。
https://serverfault.com/questions/19561/how-can-i-display-and-log-php-errors-on-iis7
- IISマネージャー>Webサイトをクリック>構成エディター>system.webServer>httpErrors>「DetailedLocalOnly」を「Detailed」に変更
9.)C:\Windows\php.ini
この構成設定を「オン」に設定しました
display_errors = On
または、IIS 7でFastCGIを使用しているので、この構成設定を「stderr」に設定する必要がありますか?
; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On
10.)\file_uploadフォルダーとそのサブフォルダーのセキュリティを変更します
IIS_IUSRSユーザーグループ(または単にIUSRユーザー)
IISAPPPOOL{アプリケーションプール}
11.)\file_upload
ファイルをIISサイトのWebルートフォルダーとして使用します