I am trying to complete an install of wordpress using php5-fpm and nginx, with a database on a remote server. However, wordpress doesn't recognize the existence of mysql to allow me to connect to the remote database.
Code to check whether the mysql extension is loaded, from php, says the extension isn't loaded:
<?php
var_dump(extension_loaded('mysql'));
mysql_connect();
Results in:
bool(false)
PHP message: PHP Fatal error: Call to undefined function mysql_connect() in /path/www/check.php on line 3
Yet everywhere seems to indicate that the pieces that should be necessary (php5-fpm, php5-mysql, mysql-client, wordpress) are in place, just the local server is necessarily -NOT- running mysql-server because that's on the remote server.
So what should I be looking for in order to try to get the extension_loaded('mysql') to be in the right state, along with everything else?
The output of the various dependencies installed follows below:
apt-cache policy mysql-client
mysql-client:
Installed: 5.5.43-0ubuntu0.14.04.1
Candidate: 5.5.43-0ubuntu0.14.04.1
Version table:
*** 5.5.43-0ubuntu0.14.04.1 0
500 http://mirror.rackspace.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://mirror.rackspace.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.35+dfsg-1ubuntu1 0
500 http://mirror.rackspace.com/ubuntu/ trusty/main amd64 Packages
apt-cache policy mysql-server
mysql-server:
Installed: (none)
Candidate: 5.5.43-0ubuntu0.14.04.1
Version table:
5.5.43-0ubuntu0.14.04.1 0
500 http://mirror.rackspace.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://mirror.rackspace.com/ubuntu/ trusty-security/main amd64 Packages
5.5.35+dfsg-1ubuntu1 0
500 http://mirror.rackspace.com/ubuntu/ trusty/main amd64 Packages
php5-mysql is also installed.
My wordpress version:
wp core version --extra
WordPress version: 4.1.1
Database revision: 30133
TinyMCE version: 4.107 (4107-20150118)
Php5 version:
php --version
PHP 5.5.9-1ubuntu4.9 (cli) (built: Apr 17 2015 11:44:57)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
The php5-fpm config
php5-fpm -i | grep mysql
/etc/php5/fpm/conf.d/20-mysql.ini,
/etc/php5/fpm/conf.d/20-mysqli.ini,
/etc/php5/fpm/conf.d/20-pdo_mysql.ini,
mysql
MYSQL_SOCKET => /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib/x86_64-linux-gnu -lmysqlclient_r
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
MYSQLI_SOCKET => /var/run/mysqld/mysqld.sock
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
PDO drivers => mysql, pgsql
pdo_mysql
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock
sudo service php5-fpm restartwasn't aware of, and which had to be killed.