Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure PHP and mysql connection under linux

Tags:

php

mysql

I encounter this problem when configure PHP and mysql on my linux box (Fedora 14).

The problem is when I invoke mysqli_connect(), an error issues:

Call to undefined function mysqli_connect().

while call to mysql_connect() works fine.

I install PHP and mysql manually and also turn on the flag --with-mysql when installing PHP. Can't figure out where things go wrong.

like image 785
Summer_More_More_Tea Avatar asked Apr 01 '26 01:04

Summer_More_More_Tea


2 Answers

Mysql-i is not Mysql, these are 2 distinct PHP modules and MySQL APIs. Have a look at PHP's documentation regarding the mysqli installation.

like image 59
soulmerge Avatar answered Apr 03 '26 18:04

soulmerge


If yum is an option for you, you can simply run the following to install the mysqli extenstion:

yum install php-mysqli

EDIT: Marc B informs that mysqli is included in the core php rpm on Fedora 14. Simply install php via yum (after removing your manual install) with yum install php

like image 20
webbiedave Avatar answered Apr 03 '26 17:04

webbiedave