Sometimes, we want to fix ‘Undefined function mysql_connect()’ with PHP.
In this article, we’ll look at how to fix ‘Undefined function mysql_connect()’ with PHP.
How to fix ‘Undefined function mysql_connect()’ with PHP?
To fix ‘Undefined function mysql_connect()’ with PHP, we can install a few packages.
We install the packages to add mysql_connect
by running
sudo apt-get install mysql-server mysql-common php7.4 php7.4-mysql
to install the missing MySQL dependencies that lets us call mysql_connect
.
Conclusion
To fix ‘Undefined function mysql_connect()’ with PHP, we can install a few packages.