首頁 > linux, 系統相關, 軟體相關 > 如何讓同一台 Apache 跟 php 同時使用 UTF-8 跟 Big5 ??

如何讓同一台 Apache 跟 php 同時使用 UTF-8 跟 Big5 ??

先在 Apache 的設定裡面加上以下的設定 ~~ 如兩個網站 111.com.tw 跟 222.com.tw

#vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot "/var/www/html/"
ServerName 111.com.tw
AddDefaultCharset Big5
<Directory "/var/www/html/">
allow from all
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "/var/www/html/catalog/"
ServerName 222.com.tw
AddDefaultCharset UTF-8
<Directory "/var/www/html/catalog/">
allow from all
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>

好了之後呢 ~~ 修改 /etc/php.ini

#vi /etc/php.ini
找到 default_charset = "xxxx" 在前面加註解 ";" 分號就可以了 ~~
#service httpd restart
重新啟動 apache

好文幫推 :

本站文章歡迎您原文引用, 還請您標示原出處喔 !!

引用網址 :

  1. 目前尚無任何的評論。
  1. 目前尚無任何 trackbacks 和 pingbacks。