I want to enable the module php5-mysql in my Ubuntu 16.04 trough the cli.
When I do apt search php
, I see php5-mysql is there
.
Then run apt-get install php5-mysql
and that is what I get :
root@25814ad2fc62:/var/www/html# apt-get install php5-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-mysql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
So the conclusion is that this module is installed but not enabled. Following that post, I see run the command php5enmod mysql and have no messages or errors.
After run php -m
I see that mysql is not there:
root@25814ad2fc62:/etc/php5/mods-available# php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
And these are available modules in my machine:
root@25814ad2fc62:/etc/php5/mods-available# ls
mysql.ini mysqli.ini opcache.ini pdo.ini pdo_mysql.ini redis.ini
So, how can I enable this mysql module in this instance of my php? I am running inside a docker container.
Edit the file:
And make sure it contains an uncommented line like this:
Lines starting with
;
are comments and are ignored.Restart
apache
ornginx
orphp-fpm
after this change.