Skip to content
Sign upLog in
← Back to Community

How to connect to an external mysql database?

Profile icon
baciotti

I am trying to connect to mysql using php but the function is not working. I am receiving this error:

Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /home/runner/conexao.php:7 Stack trace: #0 /home/runner/carro_insert.php(6): include() #1 {main} thrown in /home/runner/conexao.php on line 7

Voters
Profile icon
ION606
Profile icon
lipe44
Profile icon
charliekmcmahon
Profile icon
YOCHITUM
Profile icon
HowardLincoln
Profile icon
FredricPersson1
Profile icon
abcd10101
Profile icon
bckohn
Profile icon
Caleboliveira
Profile icon
SwordBien
Comments
hotnewtop
Profile icon
RonaldSchildge

Has there been any help on how to enable the mysqli extension?

Profile icon
baciotti

@RonaldSchildge
, unfortanelly not :(

Profile icon
Liubov5

@baciotti
did you get an answer?

Profile icon
matjung

While you cannot edit php.ini, you can create your own php.ini.
Copy the driver into a ext directory

php -c php.ini -i | grep mysql

MysqlI Support => enabled
Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24
f2847fa7519001be390c98ae0acafe387 $
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0

Then php with mysql code works if the sql server is located at another host.
Instructions for getting the drivers:
https://repl.it/talk/learn/Installing-WordPress-on-Replit/34284

Profile icon
Mr4FX

repl.it should allow users to edit PHP.ini
!! other ways repl.it will be closed source for coders

Profile icon
LuukDev

This is a problem by Repl.it, they didn't install the MySQLi extension what allows you to use a database.