如題:
如何讓apache支援utf-8編碼的檔案請求?
例如client請求perl檔案時,apache需要去讀取shebang line(即該檔的第一行),才曉得要去哪找perl處理程式.
我自己試過若將perl以xp預設的ANSI編碼存檔則沒問題.
而若以utf-8存檔,當用browser瀏覽時會出現如下錯誤訊息:
======================================================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
======================================================
以下為apache的log file紀錄:
----------------------------
[Sat Apr 09 15:18:19 2005] [error] [client 203.204.136.209] e:/appserv2-5-1/www/hello4.pl is not executable; ensure interpreted scripts have "#!" first line
[Sat Apr 09 15:18:19 2005] [error] [client 203.204.136.209] (2)No such file or directory: couldn't spawn child process: e:/appserv2-5-1/www/hello4.pl
很顯然,APACHE找不到以#!為開頭的shebang line,
問題是我的perl檔案可是有在第一行明確寫上#!e:\perl\bin\perl.exe,
所以我懷疑是apache看不懂以utf-8編碼的perl檔案,才會導致此一錯誤訊息...
書籤