r/PHPhelp • u/Rayj002025 • Jun 02 '25
Solved Fairly new to PHP
I'm using PHP 8.4, Apache/2.4.63 and mysql 8.4.5 Installed on an Oracle Vbox VM.
I am getting this error: Fatal error</b>: Uncaught Error: Call to undefined function mysqli_connect().
On another one of my systems, I am using PHP 8.1, Apache2 2.4.52 and mysql 8.0.42 installed on a virtual server. The mysqli_connect works fine.
A strange thing thing I noticed is the mysqli extension in both systems is NOT enabled in the php.ini file? I just left it alone.
The phpinfo for the failing system is not showing the mysqli section. The other system is showing the mysqli section.
Should I be posting this in a mysql forum?
Any ideas?
Thanks,
Ray
2
u/colshrapnel Jun 02 '25
Oracle Vbox VM is not an operation system, you cannot install PHP on it. Which OS you are running on that virtual machine? How did you install php on it?
In case it's Debian/Ubuntu, simply run sudo apt install php8.4-mysql and it will install mysqli.
1
u/MateusAzevedo Jun 02 '25
Well then, that's your problem.
If it works, then the extension is enabled. Depending on the OS, like Ubuntu for example,
/etc/php/x.y/mods-available/mysql.iniis created automatically afterapt install php-mysqland that's the file that loads the extension. You don't need to enable/edit anything inphp.ini.https://www.reddit.com/r/PHPhelp/search/?q=undefined+function+mysqli_connect
2
u/Jutboy Jun 02 '25
Confirm in phpinfo which php.ini you are using. Also a lot of times the files in /conf.d/ folder are setup to autoload load in.
0
u/[deleted] Jun 02 '25
[deleted] — view deleted comment