Quantcast
Channel: omnioo lab. record » PHP/MySQL
Viewing all articles
Browse latest Browse all 59

お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです

$
0
0

Wordpressを入れると「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。」何となく原因は自分でわかっていてPHP 5.5.21を無理やりインストールしてその他の設定は全然それに合わせていないっていうことだと思うわけです。

# yum list |grep php-mysql
php-mysql.x86_64  5.3.3-40.el6_6  updates 
と、こんな感じで5.3.3のままになっております。これをたぶんphp-mysql.x86_64 5.5.21-何とかにすればよいのかと思っていたら5.5から非推奨になって事実上廃止になったみたいです。

PHP 5.5 で mysql 拡張モジュールが非推奨になり、E_DEPRECATED エラーが表示されるようになりました。将来の PHP のバージョンで削除されます。 mysql 拡張モジュールに依存する CMS を使ってサイトを運用している場合、将来、運用サーバーに導入されている PHP のバージョンの切り替えに備えて、 mysqli もしくは PDO に対応した CMS のバージョンへのアップグレードするか、別の CMS やウェブサービスに切り替える必要があります。

だそうです。
すごい面倒くさそうなので、phpをダウングレードします。

php5.5がインストールされていることを確認

# yum list installed | grep php
php.x86_64                         5.5.21-1.el6.remi                 @remi-php55
php-cli.x86_64                     5.5.21-1.el6.remi                 @remi-php55
php-common.x86_64                  5.5.21-1.el6.remi                 @remi-php55
php-pear.noarch                    1:1.9.4-20.el6.remi               @remi-php55
php-pecl-jsonc.x86_64              1.3.6-1.el6.remi.5.5.1            @remi-php55
php-pecl-zip.x86_64                1.12.4-1.el6.remi.5.5             @remi-php55
php-process.x86_64                 5.5.21-1.el6.remi                 @remi-php55
php-xml.x86_64                     5.5.21-1.el6.remi                 @remi-php55

PHP削除

# yum remove php php-cli php-common php-pear php-pecl-jsonc php-pecl-zip php-process php-xml
PHPをgrepしたら何も出てこないはず。これで全部消えました。Apacheを再起動するときれいさっぱりPHPがなくって機能しなくなっております。

rpmを取得するシェルスクリプトを書いておく

適当なファイル名でrpmを取得するシェルを書いておきます。./phplist.shとか。場所はどこでもいいです。
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-cli-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-common-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-bcmath-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-dba-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-devel-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-gd-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-imap-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-ldap-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-mbstring-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-mysql-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-odbc-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-pdo-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-pear-1.9.4-7.el5.remi.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-pecl-ncurses-1.0.2-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-pgsql-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-process-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-snmp-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-soap-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-xml-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-xmlrpc-5.3.23-1.el5.remi.x86_64.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/x86_64/php-pecl-apc-3.1.13-3.el5.remi.x86_64.rpm
シェルなので、
# chmod 755 ./phplist.sh
で、実行
# ./phplist.sh

php5.3をインストールする

# yum -y install php php-mbstring php-devel php-gd php-mbstring php-mysql php-pgsql php-pear php-pecl-apc php-pecl-apc-devel php-pecl-memcache php-xml php-imap
Apacheを再起動するとPHP5.3になってます。

Viewing all articles
Browse latest Browse all 59

Trending Articles