問題描述
我有一個托管站點(diǎn),但在配置 Joomla 時遇到問題(在 IIS7 + win server 2008 上運(yùn)行 Joomla + php + mySQL).我有一個在本地機(jī)器上運(yùn)行的類似配置(IIS7 上的 Joomla + php + mySQL + vista x64),所以我至少能夠按照各種教程中顯示的說明進(jìn)行設(shè)置.
I have a hosted site and I'm having trouble configuring Joomla (running Joomla + php + mySQL on IIS7 + win server 2008). I have a similar configuration running on a local machine (Joomla + php + mySQL on IIS7 + vista x64), so I was at least able to follow instructions showed in various tutorials on how to set this up.
托管站點(diǎn)的這個癥狀是我無法在 Joomla 中打開任何 SEO 設(shè)置(甚至不是第一個設(shè)置,搜索引擎友好 URL").我得到 404(未找到文件)或 URL 顯示正確重寫,但始終顯示主頁的內(nèi)容.我在我的家用機(jī)器上遇到了類似的問題,結(jié)果證明是因為我沒有使用 FastCGI 來托管 php,所以我決定在托管站點(diǎn)上進(jìn)行調(diào)查.
This symptom with the hosted site is that I can't turn on any SEO settings in Joomla (not even the first setting, "Search Engine Friendly URLs"). I get either 404 (file not found) or the URL appears correctly rewritten but it's always the home page's content that is displayed. I had a similar issue on my home machine and it turns out to have been because I wasn't using FastCGI to host php, so I decided to investigate that on the hosted site.
無論如何,我在托管站點(diǎn)上托管 joomla 的目錄的 web.config 文件中注意到以下行:
Anyway, I noticed in the web.config file of the directory hosting joomla on the hosted site the following line:
<add name="Plesk_Handler_3522909676" path="*.php" verb="*" modules="IsapiModule" scriptProcessor="c:program files (x86)parallelspleskadditionalpleskphp5php5isapi.dll" resourceType="Either" />
根據(jù)過去的經(jīng)驗,我知道 php 在不在 fastCGI 下運(yùn)行時會出現(xiàn)一些問題.我注意到根文件夾中的 web.config 使用了以下行:
From past experience, I know that php has some issues when not running under fastCGI. I noticed the web.config in the root folder used the following line instead:
<add name="Plesk_Handler_0286090609" path="*.php" verb="*" modules="CgiModule" scriptProcessor="c:program files (x86)parallelspleskadditionalpleskphp5php-cgi.exe" resourceType="Either" />
我將其復(fù)制到 joomla 目錄的 web.config 中,并得到了不同的行為...但仍然無法正常工作.如果我在運(yùn)行 phpInfo() 的 joomla 目錄中加載一個 .php 文件,它會在 Server API 下顯示 CGI/FastCGI .是否使用了 FastCGI 的肯定確認(rèn)?為什么 web 配置中的處理程序指向 modules="CgiModule" 而不是 modules="FastCgiModule"(我什至不確定是否存在,但我只是發(fā)現(xiàn) CgiModule 的提及可疑).
I copied that in the web.config in the joomla directory, and got different behavior... but still not working. If I load a .php file in the joomla directory that runs phpInfo(), under Server API it says CGI/FastCGI . Is that positive confirmation that FastCGI is being used? Why does the handler in the web config point to modules="CgiModule" instead of modules="FastCgiModule" (I'm not even sure that exists, but I just find the mention of CgiModule suspicious).
這是一個托管站點(diǎn),據(jù)我所知,我無權(quán)訪問 ApplicationHost.config 文件...
It's a hosted site, so as far as I know I don't have access to ApplicationHost.config file...
推薦答案
這是一個簡單的測試:
- 用 創(chuàng)建一個phpinfo.php文件
- Create a phpinfo.php file with
<?php phpinfo(); ?>
里面;
請求 http://yoursite.com/phpinfo.php/foobar?foo=bar
檢查 phpinfo 的輸出并查找 _SERVER["REQUEST_URI"].
Check the output of phpinfo and look for _SERVER["REQUEST_URI"].
如果缺少此變量,則使用 CGI.如果該變量存在并正確設(shè)置為/phpinfo.php/foobar?foo=bar,則使用 ISAPI 或 FastCGI.查看服務(wù)器 API 輸出的頂部附近;它應(yīng)該設(shè)置為 ISAPI(這意味著正在使用 ISAPI)或 CGI/FastCGI(這意味著正在使用 FastCGI,因為我們已經(jīng)排除了 CGI).
If this variable is missing, then CGI is used. If the variable is present and correctly set to /phpinfo.php/foobar?foo=bar, then either ISAPI or FastCGI is used. Look near the top of the output for Server API; it should be set to either ISAPI (which means ISAPI is being used) or CGI/FastCGI (which means FastCGI is being used, since we already ruled out CGI).
這篇關(guān)于如何確定是否使用 FastCGI 來運(yùn)行 php 腳本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!