久久精品水蜜桃av综合天堂,久久精品丝袜高跟鞋,精品国产肉丝袜久久,国产一区二区三区色噜噜,黑人video粗暴亚裔

Gallery:Windows Sever 2003和IIS6上的安裝

來自站長百科
跳轉(zhuǎn)至: 導(dǎo)航、? 搜索

在托管環(huán)境下的IIS上安裝Gallery2是不可能的,除非你在該服務(wù)器上具有本地管理員權(quán)限。

該指導(dǎo)假定已安裝了Windows 2003 Server和Internet Information Server 6.0。

要求[ ]

你必須下載最新版本的MySQL和PHP.

MySQL:

  • 從以下地址下載最新的"MySQL必備安裝程序(MSI)整合包":
http://dev.mysql.com/downloads/mysql/4.1.html

PHP:

  • 下載最新版本的PHP:確保你下載的是.zip格式的歸檔文件,而不是Windows安裝程序!安裝程序不以任何方式幫助準(zhǔn)備IIS并會丟失重要的.dll文件,如php-gettext
http://php.net/downloads.php

UPDATE: PHP 5.2.0安裝程序會幫助你完成IIS整合的大部分工作。你也可以指定想要啟用的擴(kuò)展(gettext及GD2等)。你唯一需要做的事就是配置應(yīng)用程序映射并重啟IIS。這顯然是一個bug,希望在未來的版本中能夠自動完成這些。

安裝MySQL[ ]

MySQL安裝程序的默認(rèn)設(shè)定都沒問題,但有幾點(diǎn)重要的需要注意:

  • 確保你設(shè)定了root密碼!
  • 在安裝程序的第八個屏幕上選擇"Transactional"

建立數(shù)據(jù)庫[ ]

在此知道中我們使用"gallery2"作為你gallery的數(shù)據(jù)庫名稱,如果需要的話你可以用其他的名字。

  • 啟動MySQL命令行客戶端
開始菜單-> MySQL -> MySQL Server 4.1 -> MySQL命令行客戶端
  • 輸入(在MySQL安裝中所定義的)root密碼并按"回車"
  • 為gallery創(chuàng)建一個數(shù)據(jù)庫。輸入如下語句并按"回車"。
CREATE DATABASE gallery2;
  • 創(chuàng)建一用戶以訪問數(shù)據(jù)庫。將"yourPasswordHere"替換為你的密碼。輸入如下語句并按"回車"。
GRANT USAGE ON * . * TO 'gallery2'@'localhost' IDENTIFIED BY 'yourPasswordHere';
  • 賦予新數(shù)據(jù)庫上新建用戶的權(quán)限。輸入如下語句并按"回車"。
GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , ALTER ON `gallery2` . * TO 'gallery2'@'localhost';
  • 離開MySQL命令行客戶端。輸入如下語句并按"回車"。
exit

安裝PHP.[ ]

用于PHP的路徑僅為舉例,如果需要你可以使用別的路徑。

  • 將歸檔文件解壓到C:\PHP(必要的話可以重命名)
  • 重命名 C:\PHP\php.ini-recommended為C:\PHP\PHP.INI

配置對話目錄[ ]

  • 打開C:\PHP\PHP.INI

確認(rèn)移除了開頭的分號!

  • 找到
;session.save_path = "/tmp"

將其替換為

session.save_path = "C:\WINDOWS\TEMP"
  • 找到
; **針對IIS,你可以實(shí)際上也必須安全地關(guān)閉它。**
; cgi.force_redirect = 1

將其替換為

; **針對IIS,你可以實(shí)際上也必須安全地關(guān)閉它。**
cgi.force_redirect = 0

配置PHP擴(kuò)展[ ]

  • 找到
; 可載入擴(kuò)展(模塊)所在目錄。
extension_dir = "./"

將其替換為

; 可載入擴(kuò)展(模塊)所在目錄。
extension_dir = "C:\PHP\EXT"

如果在C:\PHP\PHP.INI文件中找不到"extension_dir",就將其添加到文件底部。

MySQL extension[ ]

由于Gallery2使用數(shù)據(jù)庫來存儲其元數(shù)據(jù),你需要啟用PHP中的數(shù)據(jù)庫支持。此知道使用的是MySQL,但過程與Postgres或Oracle是相似的。

  • 找到
;extension=php_mysql.dll

將其替換為

extension=php_mysql.dll

Gettext擴(kuò)展[ ]

  • In order to make the localization of g2 (multi-language) work you need the gettext extension of php. This can be enabled in php.ini. G2 does hint you for that. However gettext is a little strange extension.
  • 找到
;extension=php_gettext.dll 

將其替換為

extension=php_gettext.dll 

But now comes the crux. php_gettext.dll is depending on \php-install-dir\dll\iconv.dll All other extensions work flawlessly for me. But gettext.dll required me to put iconv.dll into a dir that is included in the searchpath. E.g. /windows/system32 I then overreacted and copied all dll's to that /system32 dir. The manual of php 4 tells you to copy the dll's to the /php-install-dir/ but that only works if you add manually the php dir into the path statement of windows.

GD2擴(kuò)展[ ]

Find the extension in your php.ini and remove the # in front of the line ;extension=php_gd2.dll

  • 找到
;extension=php_gd2.dll 

將其替換為

extension=php_gd2.dll

PHP.INI鍵值[ ]

Changing key php.ini values to suit the bigger demands of G2: The following values should be working for most of the gallery users. The max times have been upped just as a precaution. But I think that G2 overrides them anyway.

  • 找到 the following values and set to your needs.
max_execution_time = 300 ; Maximum execution time of each script, in seconds 
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data 
memory_limit = 32M ; Maximum amount of memory a script may consume (8MB)

使PHP可用于IIS[ ]

設(shè)定系統(tǒng)路徑以包括C:\PHP[ ]

  • 點(diǎn)擊我的電腦 -> 屬性 -> 高級 -> 環(huán)境變量
  • 下拉到系統(tǒng)變量(底部窗口)并雙擊PATH變量
  • 在結(jié)尾添加如下內(nèi)容(別忘了開頭的分號)
;C:\PHP
  • 點(diǎn)擊確定

使PHP.INI可用于PHP[ ]

  • 現(xiàn)在還是打開環(huán)境變量窗口并點(diǎn)擊新建
  • 變量名欄中輸入
PHPRC
  • 變量值設(shè)定為
C:\PHP

這將使得PHP.INI可用于PHP(稍后我們會對此做確認(rèn))

配置IIS[ ]

You have a choice of whether to setup PHP to use the ISAPI extension, CGI executable, or using FastCGI. The ISAPI extension is not fully stable, and the CGI executable's performance is very poor because after every request the php-cgi.exe executable is unloaded. So if the php-cgi.exe executable is always loaded into memory then that would greatly increase the performance. There are two ways of doing this.
1. Spend $500 for Zend's own WinEnabler [1]
2. Setup the free FastCGI program that does the same thing as WinEnabler

The recommended way of running PHP on IIS is using FastCGI. Below you will find instructions on how to setup PHP using ISAPI but if your site is going to serve lots of pages, you will probably want to go with FastCGI.

在IIS web服務(wù)擴(kuò)展上添加PHP ISAPI擴(kuò)展[ ]

  • Click on Start -> Administrative Tools -> Internet Information Services (IIS) Manager
  • Expand the local computer in the left pane
  • Click on "Web Service Extensions" in the left pane
  • In the right pane, click the blue underlined text, "Add a new Web service extension..."
  • Enter "PHP5 ISAPI" as the "Extension name"
  • Click the "Add..." button and browse to the php5isapi.dll file in your C:\PHP install directory
  • Click Open -> OK
  • Check the "Set extension status to Allowed" checkbox and click "OK"

向IIS站點(diǎn)添加PHP解析[ ]

注: You can add this either on the top-level Web Sites or to individual web sites beneath it. If you add it to the top-level web sites node in the left pane, it applies to all websites on the IIS instance. You can also choose to only install it on specific websites beneath the top-level node, in that case it will only apply to that site. The procedure for adding is the same for both scopes.

Be careful when applying this to the top-level node, as it will override settings defined in the individual websites beneath it.


  • In the left pane, expand Web Sites
  • Right Click the website you want to configure, and select properties
  • Open the Home Directory tab
  • Click Configuration
  • Then go to the Mappings tab
  • Click Add...
  • Enter the full path to php5isapi.dll in the "Executable" textbox or click the Browse button to browse your way to it. If you have followed the path recommendations in this guide, the fill path should be C:\PHP\php5isapi.dll
  • Enter .php in the Extension textbox
  • Select Limit to, enter GET,POST,HEAD
  • Click OK and verify that .PHP is now included in the Application extensions listbox
  • Click OK

This configures IIS to understand what to do with files ending with .php

添加腳本權(quán)限[ ]

  • While still having the Web Site Properties dialog box open, click Home Directory
  • Make sure that "Execute permissions" dropdown is set to "Scripts only".
  • Click OK

建立FastCGI[ ]

A good set of instructions for setting up FastCGI can be found here [2]. The basics are below.

  • Make sure you have PHP 4.3.x or later installed. Earlier versions of PHP require extra work to get FastCGI working.
  • Download the files at [3] and unpack isapi_fcgi.dll to c:\php\isapi_fcgi.dll.
  • Create a file using notepad named fastcgi.reg and insert the following text into it
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\FASTCGI]
"StartServers"=dword:00000005
"IncrementServers"=dword:00000002
"MaxServers"=dword:00000019
"Timeout"=dword:00000258

[HKEY_LOCAL_MACHINE\SOFTWARE\FASTCGI\.php]
"AppPath"="c:\\php\\php-cgi.exe"
"BindPath"="php-fcgi"
  • Double click the file you just created to merge those settings into the registry.
  • Next setup FastCGI the same way as you would the ISAPI filter, except everywhere you see C:\PHP\php5isapi.dll you should replace that with C:\PHP\isapi_fcgi.dll

測試PHP[ ]

  • In the left pane, right-click on the website you are working with and select Properties
  • Then go to Home Directory
  • Check the Local Path. This shows you were that websites root directory is located (If you are working with the default IIS website, the location will be C:\INETPUB\WWWROOT\)
  • Create a new file called test.php in that location
  • The contents of test.php should be:
<?php phpinfo(); ?>

Now, you need to give the anonymous internet user account and NETWORK SERVICE account read/execute permissions on the C:\PHP directory, to allow IIS to parse the .PHP files. You do this by

  • Perform this for both the IUSR and NETWORK SERVICE accounts
  • Open My Computer
  • Right-click C:\PHP
  • Select Properties'
  • Go to the Security tab
  • Click Add
  • In the Enter object names to select textbox, enter IUSR
  • Click Check Names and it should expand it to NETWORK SERVICE/IUSR_ServerName
  • Click OK'
  • Verify that the Read & Execute, List Folder Contents and Read values are set to Read.
  • Click OK'

Open the test.php file via your browser, example: http://www.example.com/test.php

A page showing your PHP configuration settings should now appear. If not, make sure you have followed ALL the steps outlined earlier in the guide.

Verify that PHP uses C:\PHP\PHP.ini by looking at the column for Configuration File (php.ini) Path Also, verify that MySQL support is loaded, and that the session_save.path is set to the correct values. If not, edit C:\PHP\PHP.ini again, set the values as outlined and then restart the IIS Web Service (IIS Manager->Right Click <servername>(Local computer)->All Tasks->Restart IIS).

After you have verified your PHP install, delete the test.php file from your website.

安裝二進(jìn)制[ ]

  • 在IIS6(Windows Server 2003)中添加Windows/IIS權(quán)限:g2data\tmp 目錄上的IIS_WPG權(quán)限。
  • 在IIS5(Windows XP)中給予g2data\tmp目錄IWAM權(quán)限。在命令行提示中輸入如下的命令:
C:\>cacls \path\to\g2data\tmp /E /G %COMPUTERNAME%\IWAM_%COMPUTERNAME%:F
  • 另見: [[Gallery:常見問題#我在Windows/IIS下G2安裝程序的模塊步驟得到了許多"Warning: exec(): Unable to fork [cmd /c ...]"(ImageMagick模塊)這樣的警告提示,該怎么辦?|我在Windows/IIS下G2安裝程序的模塊步驟得到了許多"Warning: exec(): Unable to fork [cmd /c ...]"(ImageMagick模塊)這樣的警告提示,該怎么辦?]]

ImageMagick[ ]

  • 從http://imagemagick.org/script/binary-releases.php#windows下載ImageMagick-6.2.3-0-Q16-windows-static.exe
  • 安裝到C:\IM(或者你自定的位置,不過最好放在不含空隙的文件夾結(jié)構(gòu)中)
  • 給予IUSR帳戶在C:\IM上的讀/執(zhí)行權(quán)限
  • 給予IUSR帳戶cmd.exe的讀/執(zhí)行權(quán)限

NetPBM[ ]

  • 從http://www.4wiseguys.com/filemgmt/singlefile.php?lid=19下載NetPBM-10.18.4-Win2k3或從http://mirror.geesu.net/gallery/netpbm_1.4-pl1.zip下載最小化的必要文件(包括bmptopnm和ppmtobmp)
  • 將其解壓到C:\netpbm(或者你自定的位置,不過最好放在不含空隙的文件夾結(jié)構(gòu)中)
  • 給予IUSR_machinename在C:\netpbm上讀/執(zhí)行權(quán)限(也包括文件)

jhead[ ]

Ffmpeg[ ]

  • celtic-druid下載最新的SVN快照版。它以7z格式打包,因此你可能需要7-Zip文件管理器來將其解壓。為了方便起見,你可以從geesu下載一個zip版本(rev9133)。
  • 在Ffmpeg模塊配置中指定的executable。

Dcraw[ ]

Zip/UnZip[ ]

  • 下載如下文件:
    • zip
    • unzip
    • 注:這些zip和unzip整合包來自cygwin,在同一目錄下必須含有對應(yīng)的dll文件以使其正常運(yùn)行。
  • 將文件解壓到C:\zip
  • 給予IUSR_machinename在C:\zip上的讀/執(zhí)行權(quán)限

疑難解答[ ]

常見問題[ ]

Why am I getting a CGI Application Error on my website or a "Error: HTTP POST failed (HTTP 502 Bad Gateway )" with gallery remote?[ ]

This can occur if you are uploading a file that takes over 300 seconds. Changing the max_execution_time variable in the php.ini above the default IIS value will not fix this problem. You need to change the CGITimeout property which is in the IIS metabase.

Some scripts are offered to help change this variable, but I prefer a GUI. Download this IIS Administration Pack and it will install metabase explorer.

Run the metabase explorer, then expand LM, and find W3SVC. Under this you will see a CGITimeout property, it should be set to 300 (that is the default). Increase this value so that your script can take longer to upload a file. Please realize though that ANY page hosted by IIS will have this timeout value, this is not set on a per site basis.


Why am I receiving a "Invalid access to memory location" error message?[ ]

Assuming you have installed PHP using the ISAPI dll. You now need to restart IIS. To do this, click start, then run, and type "iisreset /restart" then click ok. The problem *should* now be fixed.


備忘錄[ ]

  • 在拷貝后,確保在ggalery2 dir上設(shè)定了權(quán)限。當(dāng)文件/目錄被復(fù)制到同一個卷之中時,權(quán)限將無法被繼承。
  • 在站點(diǎn)配置中將index.php作為目錄索引進(jìn)行添加
  • 在g2data dir!! <--- !!!!上的權(quán)限
  • gallery2/config.php權(quán)限
  • cmd.exe,給予(IUSR)執(zhí)行權(quán)限(模塊激活),或自命令行運(yùn)行[cacls %COMSPEC% /E /G %COMPUTERNAME%\IUSR_%COMPUTERNAME%:R]
  • c:\windows\temp,給予(USR)寫權(quán)限或使用上傳小程序上傳后的"Upload error: Upload failed"消息。

設(shè)定文件權(quán)限的相關(guān)提示:

你應(yīng)當(dāng)使用XCACLS而不是CACLS來設(shè)定權(quán)限,CACLS無法正確地設(shè)定沿襲性。

獲取XCACLS:

http://www.microsoft.com/downloads/details.aspx?amp;amp;displaylang=en&familyid=0ad33a24-0616-473c-b103-c35bc2820bda&displaylang=en

{{{ XCACLS.vbs <你的站點(diǎn)路徑>\gallery /E /G IUSR_<computernamehere>:M

e.g.

XCACLS.vbs E:\inetpub\wwwroot\mysite.com\htdocs\gallery /E /G IUSR_WEBSERVER1:M }}}