wordpressをインストールしたのに、アクセスしてみると「お使いのサーバーの PHP では WordPress に必要な MySQL 拡張を利用できないようです。と出ることがあります。
これは、書いてある通り、mysqlの問題があるっぽいです。
php-mysqlという、PHPとmysqlをつなぐモジュールが入っていない場合も出るようですが、mysql自体がインストールされていない場合もでるようです。
ということで、mysqlをインストールしました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# yum erase php* Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package php.x86_64 0:5.4.30-1.el6.remi will be erased ---> Package php-cli.x86_64 0:5.4.30-1.el6.remi will be erased ---> Package php-common.x86_64 0:5.4.30-1.el6.remi will be erased ---> Package php-mbstring.x86_64 0:5.4.30-1.el6.remi will be erased ---> Package php-pear.noarch 1:1.9.5-1.el6.remi will be erased ---> Package php-process.x86_64 0:5.4.30-1.el6.remi will be erased ---> Package php-xml.x86_64 0:5.4.30-1.el6.remi will be erased --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Removing: php x86_64 5.4.30-1.el6.remi @remi 9.2 M php-cli x86_64 5.4.30-1.el6.remi @remi 7.7 M php-common x86_64 5.4.30-1.el6.remi @remi 6.9 M php-mbstring x86_64 5.4.30-1.el6.remi @remi 2.5 M php-pear noarch 1:1.9.5-1.el6.remi @remi 2.2 M php-process x86_64 5.4.30-1.el6.remi @remi 128 k php-xml x86_64 5.4.30-1.el6.remi @remi 626 k Transaction Summary ======================================================================================================================================= Remove 7 Package(s) Installed size: 29 M Is this ok [y/N]: n Exiting on user Command # yum install mysql Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * epel: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * rpmforge: ftp.kddilabs.jp * updates: ftp.tsukuba.wide.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be installed --> Processing Dependency: mysql-libs = 5.1.73-3.el6_5 for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: mysql-5.1.73-3.el6_5.x86_64 --> Running transaction check ---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Installing: mysql x86_64 5.1.73-3.el6_5 updates 894 k Installing for dependencies: mysql-libs x86_64 5.1.73-3.el6_5 updates 1.2 M Transaction Summary ======================================================================================================================================= Install 2 Package(s) Total download size: 2.1 M Installed size: 6.4 M Is this ok [y/N]: y Downloading Packages: (1/2): mysql-5.1.73-3.el6_5.x86_64.rpm | 894 kB 00:00 (2/2): mysql-libs-5.1.73-3.el6_5.x86_64.rpm | 1.2 MB 00:00 --------------------------------------------------------------------------------------------------------------------------------------- Total 4.0 MB/s | 2.1 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : mysql-libs-5.1.73-3.el6_5.x86_64 1/2 Installing : mysql-5.1.73-3.el6_5.x86_64 2/2 Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 1/2 Verifying : mysql-5.1.73-3.el6_5.x86_64 2/2 Installed: mysql.x86_64 0:5.1.73-3.el6_5 Dependency Installed: mysql-libs.x86_64 0:5.1.73-3.el6_5 Complete! # mysql mysql mysqladmin mysqlcheck mysqldump mysqlimport mysqlslap mysqlaccess mysqlbinlog mysql_config mysql_find_rows mysqlshow mysql_waitpid # yum install mysql-server Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * epel: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * rpmforge: ftp.kddilabs.jp * updates: ftp.tsukuba.wide.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be installed --> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-3.el6_5.x86_64 --> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-3.el6_5.x86_64 --> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-3.el6_5.x86_64 --> Running transaction check ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed ---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================= Installing: mysql-server x86_64 5.1.73-3.el6_5 updates 8.6 M Installing for dependencies: perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k perl-DBI x86_64 1.609-4.el6 base 705 k Transaction Summary ======================================================================================================================================= Install 3 Package(s) Total download size: 9.4 M Installed size: 27 M Is this ok [y/N]: y Downloading Packages: (1/3): mysql-server-5.1.73-3.el6_5.x86_64.rpm | 8.6 MB 00:01 (2/3): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm | 134 kB 00:00 (3/3): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------- Total 4.9 MB/s | 9.4 MB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : perl-DBI-1.609-4.el6.x86_64 1/3 Installing : perl-DBD-MySQL-4.013-3.el6.x86_64 2/3 Installing : mysql-server-5.1.73-3.el6_5.x86_64 3/3 Verifying : perl-DBD-MySQL-4.013-3.el6.x86_64 1/3 Verifying : mysql-server-5.1.73-3.el6_5.x86_64 2/3 Verifying : perl-DBI-1.609-4.el6.x86_64 3/3 Installed: mysql-server.x86_64 0:5.1.73-3.el6_5 Dependency Installed: perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6 Complete! |
1 2 3 |
# /etc/init.d/mysqld start [ OK ] Starting mysqld: [ OK ] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! |
ただ、それでもうまくいかなかったので、やはり、php-mysqlのせいなのかとも思いましたが、インストールされているように見えました。
そこで、以下のページにある通り、phpのアンインストールからやり直したらうまくいきました。
http://web.showjin.me/wordpress_no_php-mysql.html