0

hello I have a PHP error

Message: Call to undefined function mysqli_init()
/public_html/system/database/drivers/mysqli/mysqli_driver.php

I checked my MySQLi in server and it is working good and I tried to install packages in the server but the server told me that no package available, there are two sites in my server working good buy Codeigniter but this on I used hmvc

I see a lot of answers here but nothing success with me

NOTE

the site is working on my localhost

  • the `mysqli_driver.php` file is part of the CodeIgniter core. If it's not there, you probably have a incomplete Codeigniter installation or your `system` directory is not where CodeIgniter expects it to be. Check your main `index.php` file for `$system_path` and double check it points to the correct location of the system directory – Javier Larroulet Oct 09 '19 at 23:07
  • the mysqli_driver.php there, and the site is working in my localhost but on the server there are errors – ahmed althalgy Oct 09 '19 at 23:13
  • Did you install the php mysql extension? `apt-get install php7.2-mysql` – Alex Barker Oct 09 '19 at 23:18
  • @AlexBarker it is CentOS so this command not working and I tried to replace apt with yum still not working – ahmed althalgy Oct 09 '19 at 23:50
  • could you double check in `php.ini` whether `mysqli` extension is there and active. and could you post the command you tried to install php mysql? did you try `sudo yum install php-mysqli`? – Bagus Tesa Oct 10 '19 at 01:45
  • @BagusTesa I tried this `Sudo yum install php-mysqli` and the answer was `No package php-mysqli available. Error: Nothing to do` – ahmed althalgy Oct 10 '19 at 14:24
  • Running PHP under Redhat is unpleasant. I am not sure what version of CentOS you are using, or more importantly where you got PHP. It says you are using PHP 7.3 in you question, however, no version of Redhat comes with that version of PHP. If you are not using CentOS 8, you only get PHP 5.4 from upstream. Check your PHP source for the mysqli extension. If you compiled it from source, you need to --enable it during the configure process. – Alex Barker Oct 10 '19 at 16:44
  • thanks, I solved the problem with your advice, thanks – ahmed althalgy Oct 10 '19 at 17:24

0 Answers0