15,024
edits
m (→執行PHP時顯示原始碼的錯誤) |
|||
| Line 27: | Line 27: | ||
** 網頁伺服器放置 [http://php.net/manual/en/function.phpinfo.php phpinfo]/ [http://www.commandlinefu.com/commands/view/818/phpinfo-from-the-command-line phpinfo from the command line | commandlinefu.com] 或 | ** 網頁伺服器放置 [http://php.net/manual/en/function.phpinfo.php phpinfo]/ [http://www.commandlinefu.com/commands/view/818/phpinfo-from-the-command-line phpinfo from the command line | commandlinefu.com] 或 | ||
** {{kbd | key = <nowiki>php -v</nowiki>}} 如果可以顯示 PHP 版本,代表有安裝 PHP | ** {{kbd | key = <nowiki>php -v</nowiki>}} 如果可以顯示 PHP 版本,代表有安裝 PHP | ||
* 如果 PHP 使用 short | * 如果 PHP 使用 short tag 語法撰寫,但是沒有啟用 short_open_tag ,會造成顯示原始碼的錯誤。驗證方式: | ||
** (1) 輸入指令 {{kbd | key = <nowiki>php -i | grep short_open_tag</nowiki>}} (2) php.ini 檔案 需要開啟 short_open_tag = Off -> On (3) 重新啟動網頁伺服器服務,讓 php.ini 修改生效 | ** (1) 輸入指令 {{kbd | key = <nowiki>php -i | grep short_open_tag</nowiki>}} (2) php.ini 檔案 需要開啟 short_open_tag = Off -> On (3) 重新啟動網頁伺服器服務,讓 php.ini 修改生效 | ||