php-mcrypt
CentOS5.6がリリースされたので開発環境をアップデート。
ついでにPHPも5.3系を入れてみた。
以前の記事にも書いたが、php-mcryptがRedHatでサポートされなくなった。
phpMyAdmin使いたいという要望があるので、どうにかしてphp-mcryptをインストールする方法をご紹介。
1.php53のSRPMを取得する。
# wget ftp://ftp.riken.jp/Linux/centos/5.6/updates/SRPMS/php53-5.3.3-1.el5_6.1.src.rpm
2.SRPMをインストール
# rpm -i php53-5.3.3-1.el5_6.1.src.rpm
3.インストールされたソース確認
# cd /usr/src/redhat/SOURCES
# ls
4.mcryptのあるディレクトリへ
# cd /usr/src/redhat/SOURCES/php-5.3.3/ext/mcrypt
5.mcryptをコンパイル
# ./configure
# make
# make install
Installing shared extensions: /usr/lib/php/modules/
この辺にインストールされているはず。
6.mcrypt有効化
# cd /etc/php.d
# vi mcrypt.ini
extension=mcrypt.so
7.httpdを再起動
※SRPMからじゃなくて、普通にphp5.3.3のソースを展開しても大丈夫な気がする。
Scientic Linux 6.0 α4のMySQLの続き
日本語が文字化けする件わかりました。
テーブルのカラム欄が、latin1になってました。
createするときこの辺注意しないとダメですね。
RedHatEL5.6のPHP5.3を野良コンパイル
先日、RedHatEL5.6がリリースされた。
php53というパッケージが追加され、EL6に移行しなくてもPHP5.3が使えるようになる。
CentOS5.6が待てないので、とりあえずRedHatのphp53パッケージをCentOS5.5で野良コンパイルしてみた。
CentOS5.6にアップデートしてもたぶん大丈夫だろう。
SRPMをダウンロードしてくる
ここらへんから
http://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/
php53-5.3.3-1.el5.src.rpm
野良コンパイルの準備
一般ユーザーの場合は↓参照
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/952rpmbuild.html
ビルドコマンド実行
$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm warning: InstallSourcePackage: Header V3 DSA signature: NOKEY, key ID 37017186 warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root error: Failed build dependencies: bzip2-devel is needed by php53-5.3.3-1.el5.x86_64 curl-devel >= 7.9 is needed by php53-5.3.3-1.el5.x86_64 db4-devel is needed by php53-5.3.3-1.el5.x86_64 gmp-devel is needed by php53-5.3.3-1.el5.x86_64 httpd-devel >= 2.0.46-1 is needed by php53-5.3.3-1.el5.x86_64 pam-devel is needed by php53-5.3.3-1.el5.x86_64 openssl-devel is needed by php53-5.3.3-1.el5.x86_64 sqlite-devel is needed by php53-5.3.3-1.el5.x86_64 zlib-devel is needed by php53-5.3.3-1.el5.x86_64 pcre-devel >= 6.6 is needed by php53-5.3.3-1.el5.x86_64 libtool >= 1.4.3 is needed by php53-5.3.3-1.el5.x86_64 krb5-devel is needed by php53-5.3.3-1.el5.x86_64 libc-client-devel is needed by php53-5.3.3-1.el5.x86_64 cyrus-sasl-devel is needed by php53-5.3.3-1.el5.x86_64 openldap-devel is needed by php53-5.3.3-1.el5.x86_64 mysql-devel >= 4.1.0 is needed by php53-5.3.3-1.el5.x86_64 postgresql-devel is needed by php53-5.3.3-1.el5.x86_64 unixODBC-devel is needed by php53-5.3.3-1.el5.x86_64 libxml2-devel is needed by php53-5.3.3-1.el5.x86_64 net-snmp-devel is needed by php53-5.3.3-1.el5.x86_64 libxslt-devel >= 1.0.18-1 is needed by php53-5.3.3-1.el5.x86_64 libxml2-devel >= 2.4.14-1 is needed by php53-5.3.3-1.el5.x86_64 libXpm-devel is needed by php53-5.3.3-1.el5.x86_64 libjpeg-devel is needed by php53-5.3.3-1.el5.x86_64 libpng-devel is needed by php53-5.3.3-1.el5.x86_64 freetype-devel is needed by php53-5.3.3-1.el5.x86_64 aspell-devel >= 0.50.0 is needed by php53-5.3.3-1.el5.x86_64 libicu-devel >= 3.6 is needed by php53-5.3.3-1.el5.x86_64
なんかいっぱい要求されたw
warning〜は気にしなくていいらしい。
とりあえず、rootになって要求されたパッケージインストール
# yum install -y bzip2-devel curl-devel db4-devel gmp-devel httpd-devel pam-devel openssl-devel sqlite-devel zlib-devel pcre-devel libtool krb5-devel libc-client-devel cyrus-sasl-devel openldap-devel mysql-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel libXpm-devel libjpeg-devel libpng-devel freetype-devel aspell-devel libicu-devel
再度コンパイル実行
$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm
まだ何か足りなさそう。
checking for bison... no checking for byacc... no checking for bison version... invalid configure: WARNING: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 (found: none). checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. # yum install bison byacc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: ftp.riken.jp * base: ftp.riken.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Setting up Install Process Resolving Dependencies
-
- > Running transaction check
- > Finished Dependency Resolution
re2cも入れておく
# wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download # tar xfz re2c-0.13.5.tar.gz # cd re2c-0.13.5 # ./configure # make # make install
なんかまだPHPのチェックでエラーでてる・・・
えい。めんどくさい。開発関係ぜんぶいれてやれ。
# yum groupinstall "Development Tools" # yum groupinstall "Development Libraries"
$ rpmbuild --rebuild --target x86_64 --define 'dist .el5' php53-5.3.3-1.el5.src.rpm (省略) ===================================================================== FAILED TEST SUMMARY
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
なんかテストまだエラーでてるけど・・・。ま、いっか。
とりあえず、rpmはできたので。
$ cd ../RPMS $ ll -G -g total 13332 -rw-r--r-- 1 4345396 Jan 27 16:06 php53-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 85009 Jan 27 16:06 php53-bcmath-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 2751789 Jan 27 16:06 php53-cli-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 1247899 Jan 27 16:06 php53-common-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 137380 Jan 27 16:06 php53-dba-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 611538 Jan 27 16:06 php53-devel-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 347931 Jan 27 16:06 php53-gd-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 113370 Jan 27 16:06 php53-imap-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 343364 Jan 27 16:06 php53-intl-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 69120 Jan 27 16:06 php53-ldap-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 1535891 Jan 27 16:06 php53-mbstring-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 313225 Jan 27 16:06 php53-mysql-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 122708 Jan 27 16:06 php53-odbc-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 178956 Jan 27 16:06 php53-pdo-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 185038 Jan 27 16:06 php53-pgsql-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 105595 Jan 27 16:06 php53-process-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 43657 Jan 27 16:06 php53-pspell-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 48589 Jan 27 16:06 php53-snmp-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 382597 Jan 27 16:06 php53-soap-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 427156 Jan 27 16:06 php53-xml-5.3.3-1.el5.x86_64.rpm -rw-r--r-- 1 143052 Jan 27 16:06 php53-xmlrpc-5.3.3-1.el5.x86_64.rpm
php-mcryptはサポートされてないんだ・・・。
ショボーン(´・ω・`)
とりあえずできたものはこの辺に保存。
ftp://ns.cool-creators.com/pub/centos/5/RPMS/
Scientic Linux 6.0 α4のMySQL
RHEL6.0の再編集版であるScientic Linux6.0のα4をインストールしてみた。
とりあえずどんな感じになってるのかの途中検証。
PHP5.3でMySQLも5.1と快適なパッケージ構成になっています。
テスト的に使ったのですが、どうしてもMySQLに日本語がINSERTできない。
[root@sl6a4 html]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 156 Server version: 5.1.47 Source distribution mysql> use sample db; mysql> set names utf8; mysql> INSERT INTO member (name) VALUE ('test'); mysql> INSERT INTO member (name) VALUE ('日本語test'); mysql> INSERT INTO member (name) VALUE ('日本語テスト'); mysql> INSERT INTO member (name) VALUE ('テスト'); mysql> SELECT * FROM member; +----+---------+ | id | name | +----+---------+ | 19 | test | | 20 | ???test | | 21 | ?????? | | 22 | ??? | +----+---------+ 4 rows in set (0.00 sec)
日本語が全部?で返ってくる。
PHP側から実行しても同じ。
set namesが効かないのかな・・・。
mysql> show variables like 'char%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec)
現時点で不明ということで・・・。
openx 2.8.5
DBの文字化け対応
■openx/lib/OA/DB.php
追加場所:
$oDbh->setFetchMode(MDB2_FETCHMODE_ASSOC);
上記の下に追加:
$oDbh->query(“SET NAMES utf8”);
■openx/lib/OA/Dal/Delivery/mysql.php
追加場所:
if (@mysql_select_db($dbName, $dbLink)) {
上記の下に追加:
@mysql_query(“SET NAMES utf8”);
上記を設定しなくても、var/hogehoge.conf.phpの中で
[databaseCharset]
checkComplete=1
clientCharset=utf8
とすれば大丈夫かも。(未確認)