いつもお世話になっています。
さくらインターネットの共用サーバにPHP5,PEARをインストールし、
PHPプログラムにて、mb_convert_encoding()を実行すると、
Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unable to detect character encoding in ・・・
と表示されました。
php.iniの設定内容を疑って、内容を確認したところ、
さくらインターネットのコントロールパネルからphp.iniを更新しているのですが、
phpinfo()で見るとmbstringの設定項目が反映されていないのです。
■phpinfo()の表示内容:
Multibyte Support enabled
Multibyte string engine libmbfl
Multibyte (japanese) regex support enabled
Multibyte regex (oniguruma) version 4.4.4
Multibyte regex (oniguruma) backtrack check On
DirectiveLocal ValueMaster Value
-------------------------------------------------------------
mbstring.detect_orderno valueno value
mbstring.encoding_translationOffOff
mbstring.func_overload00
mbstring.http_inputpasspass
mbstring.http_outputpasspass
mbstring.internal_encodingISO-8859-1no value
mbstring.languageneutralneutral
mbstring.strict_detectionOffOff
mbstring.substitute_characterno valueno value
■php.iniの中の下記の設定項目が反映されていることは確認できました。
cgi.fix_pathinfo=1
register_long_arrays = on
■mbstringのphp.iniでの設定は下記の通りです。
mbstring.language = Japanese
mbstring.internal_encoding = EUC-JP
mbstring.http_input = auto
mbstring.http_output = SJIS
mbstring.encoding_translastion = On
mbstring.detect_order = auto
mbstring.substitute_character = none;
■phpinfo()で表示したその他の項目
・PHP Version 5.2.1
・FreeBSD
・Configuration File (php.ini) Path /home/example/www/php.ini
--------------------------------------------------------------
さくらインターネットのコントロールパネルからphp.iniを更新すると通常は実行時に反映されるのですが、
なぜ、mbstringに関しての設定が反映されないのか、どうすれば反映されるようになるか、わかる方がいらしたら教えてください。
A 回答 (1件)
- 最新から表示
- 回答順に表示
No.1
- 回答日時:
PHPを --enable-mbstring でmakeした?
この回答への補足
はい、makefileを作る前の conf.sh の内容は下記の通りで、
--enable-mbstring=all
としているので、問題はないと思います。
------------------------------------------
#!/bin/sh
./configure \
--prefix=$HOME \
--with-config-file-path=$HOME/www/php.ini \
--program-suffix=5 \
--with-pear=$HOME/share/pear5 \
--enable-force-cgi-redirect \
--enable-mbstring=all \
--enable-mbregex \
--enable-mbstr-enc-trans \
--enable-versioning \
--enable-trans-sid \
--with-mysql \
--with-openssl=/usr \
--with-soap=yes \
--with-zlib=/usr \
--with-gd=/usr/local \
--with-jpeg-dir=/usr \
--with-freetype-dir=/usr \
--with-ttf \
--with-png-dir=/usr \
--with-curl
------------------------------------------
ちなみに、php.ini には、
output_handler = mb_output_handler
の設定も加えていますが、こちらも、
phpinfo()による内容表示画面では反映されていません。
部分的に自己解決しました。
PHP5をインストールするときのconfigureの設定ミスでした。
--with-config-file-path=/home/example/www/php.ini
ではなく、
--with-config-file-path=/home/example/www
とすべきでした。
これは、このオプションが php.ini へのファイルパスを指定するのではなく、
php.ini の検索ディレクトリパスを指定するものであったからです。
この結果、実行時に
Warning: mb_convert_encoding() [function.mb-convert-encoding]: Unable to detect character encoding in ・・・
は表示されなくなったものの、文字化けしたままの状態です。
phpinfo()で確認したところ、mbstring.encoding_translation以外の
設定はphp.iniでの内容が反映されていることが確認できました。
なぜ、mbstring.encoding_translation が反映されないかは、また別問題ですので、別件で質問を挙げます。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・人生のプチ美学を教えてください!!
- ・10秒目をつむったら…
- ・あなたの習慣について教えてください!!
- ・牛、豚、鶏、どれか一つ食べられなくなるとしたら?
- ・【大喜利】【投稿~9/18】 おとぎ話『桃太郎』の知られざるエピソード
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
php.ini を設定を変更すると再...
-
PDFlib・・・日本語表示の設定??
-
Call to undefined function mb...
-
PHPのアンインストール
-
MySQL、php.ini の設定
-
dreamweaver でphpファイルをロ...
-
XAMMPについて
-
SOAP/Client.phpを認識できない?
-
【現在、初期設定段階】php4apa...
-
PATHは;C:\\xampp\\phpでOK^^
-
PHPのif文でその処理を途中で抜...
-
FTPコマンドでディレクトリごと...
-
onedrive にexcelファイルをア...
-
VBSの「MsgBox」について
-
ImageCreate関数が undefined f...
-
.phpと.incファイルの違いはな...
-
.phpファイルが、表示されない
-
Subversionのリポジトリの削除
-
FTPClientで転送結果(OKかFAIL)
-
【file_exists】ファイルが存在...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
php.ini を設定を変更すると再...
-
Fatal error: Call to undefine...
-
XAMMPについて
-
xamppのDocumentRootでindex,ht...
-
ZendFrameworlkでZend_Session...
-
phpMyAdminはSSL下でアクセスす...
-
さくらインターネットでphp.ini...
-
pearのパッケージについて
-
サイト探してます★PHP・・・php...
-
xamppでGDを使いたい。
-
ロリポップでのphp.iniの編集の...
-
ubuntuで、phpのパスを通す
-
php.iniの設定が反映されない
-
PHPは複数インストールされてい...
-
php.ini の mbstring.encoding...
-
xampp phpエラーについてです。
-
globで日本語のファイル名が文...
-
指定されたモジュール・・・
-
Apache(Ver 2.4.4)の設...
-
mSQL関数って、何?(汗)
おすすめ情報