0

I'm running an Ubuntu 14.04.5 LTS server -- LAMP configuration.

I have an older script that I call every 10 minutes as a cronjob. It was working fine until today when I ran a security update using: sudo apt-get update sudo apt-get upgrade

Now, the script does not work with the cron, nor does it work from CLI, but it does work fine in a web broswer.

From CLI, I get the following error:

PHP Fatal error: Uncaught Error: Class 'mysqli' not found in [path to php script]

I did reboot the server, and restarted Apache.

How do I fix this so it will run as a cron job again? Thanks.


INFO ABOUT SETUP

php -v

PHP 7.1.10-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Sep 29 2017 17:33:22) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.10-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

php -m

[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache
  • It looks like your PHP installation no longer has the mysql drivers. You'll have to add them back in. `sudo apt-get install php7-mysql` or `php7.1-mysql`. You may have to run `sudo apt-cache search php | grep mysql` to find the right version. – aynber Oct 17 '17 at 12:24
  • Hey, thanks! An easy fix. :) Thanks for pointing me in the right direction. – user4501876 Oct 17 '17 at 12:37

0 Answers0