0

Community, I'm going crazy over this error. I searched the site and although I found many answers about it (I believe I tried them all), I could not fix my problem.

Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in C:\Users\Laureano\Desktop\Udemy\Web Dev\AppSalon_fin\includes\database.php:3 Stack trace: #0 {main} thrown in C:\Users\Laureano\Desktop\Udemy\Web Dev\AppSalon_fin\includes\database.php on line 3

This is what I've tried so you can cross it off the list.

  1. My php.ini file has been edited in order to have:

Everytime I changed the .ini file I restarted the server from Windows Services: enter image description here

Now, I don't really know what else to do. If you can give me a hand I would much aprecciate it.

  • 1
    Two things: first in the php.ini set only one extension_dir (so remove the one with just "ext"). Secondly, restart the PHP/Apache server (not the Mysql database service). To see if things are working, make a PHP file with ``, if you open that page it should tell you which configuration is loaded (extension_dir) and which extensions. – ArendE Jan 28 '21 at 23:35
  • @ArendE - thank you for your answer. I did the first step. Now, the second part, how can I restart the apache server or where do I find it? All I'm doing step by step is: Open VSCode > Open my database.php file in the browser using a extension called PHP Server > Then It gives me that error. I never manually started an apache server nor I know how to do it. Let me know if you need any more info and thank you again. – Herrschaft Jan 28 '21 at 23:48
  • I've never used PHP Server inside VSCode, but peeking at the documentation you should have the command "PHP Server: Reload server" available. https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver – ArendE Jan 28 '21 at 23:51
  • @ArendE Jesus Christ I can't believe I didn't see that. Thank you very much, it's working now! – Herrschaft Jan 28 '21 at 23:58
  • Good to hear so! Happy coding :) – ArendE Jan 29 '21 at 00:01

0 Answers0