0

I am trying to set up this PHP-Login-System from GitHub. Specifically the Installation step 2.

When I try to open and preview the home/index.php file in the browser, I get this error.

Fatal error: Uncaught Error: Call to undefined function `enter code 
here`mysqli_connect() in C:\xampp\htdocs\PHP-Login- 
System\assets\setup\db.inc.php:6 Stack trace: #0 
C:\xampp\htdocs\PHP-Login-System\assets\layouts\header.php(6): 
require() #1 C:\xampp\htdocs\PHP-Login-System\home\index.php(4): 
include('C:\\xampp\\htdocs...') #2 {main} thrown in 
C:\xampp\htdocs\PHP-Login-System\assets\setup\db.inc.php on line 6

So far I have removed the semicolon from the start of the line extension=php_msqli in the php.ini file. Reset the computer (windows 11)

Choych
  • 81
  • 10
  • 1
    Both things are completely independent. The error you get back shows that the ``mysqli`` extension is not loaded into your http server's php engine. Without that the functions that extension provides do not exist. Which is what the message says. That has nothing to do with the application setup you pasted. – arkascha Jul 19 '22 at 04:41
  • If that is a system you have adminstrative control over you should check the php packages installed. Beside the base packages for the engine itself and the module wrapper for the http server you need various php extensions that are typically installed package wise via your systems software management system. So check what php packages that system offers and decide which ones you want/need to use in your application. – arkascha Jul 19 '22 at 04:43
  • @arkascha thank you for that information, I removed the application setup stuff out of my post. I am currently trying to add the mysqli extension into my HTTP server's PHP engine and I am having difficulty with that. So far I have removed the semicolon from the start of the line extension=php_msqli in the php.ini.developer file and reset the computer (windows 11) – Choych Jul 19 '22 at 17:12
  • OK, you are using MS-Windows, not Linux. That means you do not have a software management system, you cannot install single packages as suggested. You need to take care to "install" a php package you download from somewhere on the internet which includes the mysqli extension. Then you can indeed change the configuration and you need to restart the container with the php engine. What that is depends on your setup, either a module inside your http server or a separate fcgi service. And you need to monitor the error log file when you restart things to see of the extension could be loaded or not. – arkascha Jul 19 '22 at 20:09
  • Note that there are probagbly more than one single "php.ini" file. One for CLI usage, one for module usage, one for cgi usage. Depends on what distribution of php your installed. – arkascha Jul 19 '22 at 20:11
  • I just see you are using xampp. So you actually use an apache http server and (most likely) "mod_php" as the php engine packaged as a module to be loaded into that http server. So you need the "php.ini" file configuring that module, not another one. And you need to restart the http server process after you changed that php configuration. That will in turn also reload the php module. – arkascha Jul 19 '22 at 20:12
  • @arkasha I got it to work! Thanks a million for helping me with my first real StackOverflow question. – Choych Jul 20 '22 at 03:01
  • You are welcome. Maybe you want to leave a short note what the actual issue was, so how you solved it in the end. – arkascha Jul 20 '22 at 05:21
  • I would, but I'm not quite sure how I didn't it. I did too many things without checking between each troubleshooting step. :> – Choych Jul 20 '22 at 14:33

0 Answers0