Linux カテゴリーアーカイブ

Red Hat Entreprise Linux 5 / CentOS 5の環境で「Unicode properties」のサポートが無いので
preg_matchやpreg_replaceで\pとか使おうとするとPHP Warningが出ます。

PHP Warning: preg_replace() [function.preg-replace]: Compilation failed: support for \\P, \\p, and \\X has not been compiled at offset 16 in

確認するにはpcretest -Cで確認できます。
# pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
No Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack

「No Unicode properties support」・・・サポートしてませんね(´д`)
リビルドするのは面倒なのでできものを頂いてきました。
ここからpcre-66-27×86_64.rpmをDLしてインストール。
# wget http://gaarai.com/wp-content/uploads/2009/01/pcre-66-27x86_64.rpm
# rpm -ivh pcre-66-27x86_64.rpm
# /etc/rc.d/init.d/httpd restart

再度pcretest -Cで確認
# pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack

「Unicode properties support」になりました。
PHP Warningも消えたので良しとしよう(笑)

本番環境にCentOS 5.4入れちゃったっ!
げふん。げふん。
本当は少し待つつもりでしたが入れてみました。

CentOS 5.4 リリースノートで変更点はみてください。

アップデート手順は下記で行いました。

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update
yum update kernel\*
shutdown -r now

無事に起動したら・・・再度yum updateを実行してください。
うちでは下のエラーがでました(汁

Transaction Check Error:
  file /usr/share/emacs/site-lisp/psvn.el from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/de/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/es/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/fr/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/it/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/ja/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/ko/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/nb/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/pl/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/pt_BR/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/sv/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/zh_CN/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/locale/zh_TW/LC_MESSAGES/subversion.mo from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/man/man1/svn.1.gz from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/man/man1/svnadmin.1.gz from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/man/man1/svnlook.1.gz from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/man/man5/svnserve.conf.5.gz from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/man/man8/svnserve.8.gz from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386
  file /usr/share/xemacs/site-packages/lisp/psvn.el from install of subversion-1.6.5-0.1.el5.rf.x86_64 conflicts with file from package subversion-1.4.2-4.el5_3.1.i386

Error Summary
-------------

subversionの64bit版を入れたいが32bit版が入ってるから無理だよ と解釈して・・・

# rpm -e subversion-1.4.2-4.el5_3.1.i386

を実行して32bit版をアンインストール

その後、yum updateをしたら問題なくsubversionの64bit版がインストールできました。
他にもperl-Archive-Zip等がアップデートされてました。

動作確認してみましたが特に問題ないのでアップデート完了です(゜-゜)

念のため・・・
# cat /etc/redhat-release
CentOS release 5.4 (Final)
になってるか確認するといいかも(^^♪

そういえばPHPの設定をしていなかったなと思ってはいたけど、
実害がなかったので放置プレイしてました(笑)

ところがWordPressのページを更新しようと思ったら白紙ページが表示されました。
Apacheのログをみると下記が出力されました。

Allowed memory size of 33554432 bytes exhausted (tried to allocate 17 bytes)
Allowed memory size of 33554432 bytes exhausted (tried to allocate 17 bytes)
Allowed memory size of 33554432 bytes exhausted (tried to allocate 17 bytes)
Allowed memory size of 33554432 bytes exhausted (tried to allocate 17 bytes)
Allowed memory size of 33554432 bytes exhausted (tried to allocate 64 bytes)

PHPのメモリ割り当てが足りなくなった場合に出るエラーですね。
PHP.INIのmemory_limitの設定値を確認すると・・・デフォルトの32MBのままでした(汁
どれくらい割り当てるかは算出するのが面倒だったので
倍の64MBを割り当ててこっそりApacheを再起動。

次にエラーが出る前にきっちりとした値を決めて割り当てしたいともいます。
う~ん。他に抜けてる設定あったかな・・・。

たまにしか使わないので忘れないようにメモ。

OSによってパスが違うので適用に読み替えてください。

・起動
/etc/rc.d/init.d/httpd start

・停止
/etc/rc.d/init.d/httpd stop

・再起動
/etc/rc.d/init.d/httpd restart

・設定ファイルの再読み込み
/etc/rc.d/init.d/httpd reload

・設定ファイルの書式チェック
/etc/rc.d/init.d/httpd configtest

・状態確認
/etc/rc.d/init.d/httpd status

・プロセスを切断しないで再起動
/etc/rc.d/init.d/httpd graceful

捕捉:
gracefulはプロセスの通信が終わるのを待って、
順次新しい設定を反映したhttpdを起動させる方法。
Webサーバを公開していて、サービスの停止が出来ない場合に便利。

最近再起動よりgracefulを多用している気が(笑)

※実行前にテストDB等でテスト後に本番に適用してください。
※この記事内を参考にする場合は、自己責任でお願いします。

続きを読む

来月くらいまでまつつもりやったけど・・・無理でした(笑)
本番環境にCentOS 5.3入れちゃったっ!

適当にサービスあげてるけど・・・CentOS 5.2 → 5.3 へのUpDateはyumで
# yum update glibc\* && yum update
でさっくりとUpdateしました。

*.conf.rpmnewって感じで何個か設定ファイルの新しいのが保存されてたので、旧ファイルと見比べて修正箇所を適用して鯖再起動で完了っと。
とりあえず影響でてないのでこのまま使います~。

人柱になりたい衝動を我慢できませんでした(笑)

CentOS 5.3 Release
2009年04月02日(木曜日) 11時15分 |

CentOS 5.3CentOS 5.3がReleaseされました。
CentOS 5.3 リリースノートで変更点はみてください。

テスト環境の5.2からyumでUPDATEしてみました。

Install 8 Package(s)
Update 229 Package(s)
Remove 0 Package(s)
Total download size: 304 M
らしいです。
※テスト環境は最小インスコなので通常はもっと多いかと。

続きを読む