###mysqliを実行したい
GCP(Google Cloud Platform)でWEBサーバを立ち上げたいと思い
以下のページを参考にGCEでサーバ(centos7)を立ち上げ、ApacheとPHP5.6をインストールしました。
http://weblabo.oscasierra.net/centos7-php56-install/
GCPのSQLでデータベースを作成し、いざPHPからDBに接続しようとしたら以下のようなエラーが発生してしまいました。
mysqliを利用できるような設定はどのようにして行えばよいのでしょうか?
そもそもPHP5.6でもmysqliを利用する場合このようにPHPとは別にモジュールをインストールしてあげなければならないのでしょうか?
###エラーメッセージ
Fatal error: Class 'mysqli' not found in /var/www/html/lib/init.php on line 9
mysqliが使えませんでした…
###試したこと
ググってみると以下のページでmysqliを有効にする方法があったのですが、php_mysqli.dllが見つかりませんでした。
http://php-mysql-ref.com/page/fatal-error-class-mysqli-not-found.html
$ sudo find / -name "php_mysqli.dll" $ sudo find / -name "*.dll"
mysqliのインストール方法が書かれていたのでこちらを実行してみたのですが駄目でした。
http://qiita.com/sango/items/a86f9b8cf8c9c641823a
$ sudo yum -y install php-mysqli Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.cisp.com * epel: mirror.steadfast.net * extras: mirror.eboundhost.com * remi-safe: mirrors.mediatemple.net * updates: mirror.tzulo.com Resolving Dependencies --> Running transaction check ---> Package php-mysql.x86_64 0:5.4.16-36.1.el7_2.1 will be installed --> Processing Dependency: php-pdo(x86-64) = 5.4.16-36.1.el7_2.1 for package: php-mysql-5.4.16-36.1.el7_2.1.x86_64 --> Running transaction check ---> Package php-pdo.x86_64 0:5.4.16-36.1.el7_2.1 will be installed --> Processing Dependency: php-common(x86-64) = 5.4.16-36.1.el7_2.1 for package: php-pdo-5.4.16-36.1.el7_2.1.x86_64 --> Finished Dependency Resolution Error: Package: php-pdo-5.4.16-36.1.el7_2.1.x86_64 (updates) Requires: php-common(x86-64) = 5.4.16-36.1.el7_2.1 Installed: php-common-5.6.23-1.el7.remi.x86_64 (@remi-php56) php-common(x86-64) = 5.6.23-1.el7.remi Available: php-common-5.4.16-36.el7_1.x86_64 (base) php-common(x86-64) = 5.4.16-36.el7_1 Available: php-common-5.4.16-36.1.el7_2.1.x86_64 (updates) php-common(x86-64) = 5.4.16-36.1.el7_2.1 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
###最後に
今までは安いレンタルサーバーを借りてFTPでファイルを上げることしかしなかったのでサーバについての知識はかなり乏しいのですが、どなたかご教授お願い致します。
#追記
sudo yum -y --enablerepo=remi install php-mysql
を実行してみたのですが状況に変化がありませんでした。
$ sudo yum -y --enablerepo=remi install php-mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.cisp.com * epel: mirror.steadfast.net * extras: mirror.eboundhost.com * remi: mirrors.mediatemple.net * remi-safe: mirrors.mediatemple.net * updates: mirror.tzulo.com Resolving Dependencies --> Running transaction check ---> Package php-mysql.x86_64 0:5.4.45-10.el7.remi will be installed --> Processing Dependency: php-pdo(x86-64) = 5.4.45-10.el7.remi for package: php-mysql-5.4.45-10.el7.remi.x86_64 --> Running transaction check ---> Package php-pdo.x86_64 0:5.4.45-10.el7.remi will be installed --> Processing Dependency: php-common(x86-64) = 5.4.45-10.el7.remi for package: php-pdo-5.4.45-10.el7.remi.x86_64 --> Finished Dependency Resolution Error: Package: php-pdo-5.4.45-10.el7.remi.x86_64 (remi) Requires: php-common(x86-64) = 5.4.45-10.el7.remi Installed: php-common-5.6.23-1.el7.remi.x86_64 (@remi-php56) php-common(x86-64) = 5.6.23-1.el7.remi Available: php-common-5.4.16-36.el7_1.x86_64 (base) php-common(x86-64) = 5.4.16-36.el7_1 Available: php-common-5.4.16-36.1.el7_2.1.x86_64 (updates) php-common(x86-64) = 5.4.16-36.1.el7_2.1 Available: php-common-5.4.45-9.el7.remi.x86_64 (remi) php-common(x86-64) = 5.4.45-9.el7.remi Available: php-common-5.4.45-10.el7.remi.x86_64 (remi) php-common(x86-64) = 5.4.45-10.el7.remi You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/05 14:09
退会済みユーザー
2016/07/05 14:10
2016/07/05 14:32