Following the tutorials on this site when I try to connect to my mysql database with mysqli_connect('localhost', 'root', 'password'); I get the following error:
Fatal error: Call to undefined function mysqli_connect()
I am running windows Vista, PHP 5.3.3 and Apache 2.2.
My php.ini file is allowing the "php_mysqli.dll" extension and I've uncommented the 127.0.0.1 line in my windows hosts file as some people have suggested.
Finally I've tried swapping "localhost" with "127.0.0.1" in my PHP script and have still had no luck.
I've searched every forum I can find and have run out of things to try.
how have you installed PHP and Apache on your server?
if you installed them separately then you probably have a configuration issue somewhere.
another option you might want to consider is to delete your installation of PHP, Apache and MySQL (if you have it) and install a free open source local web server like XAMPP.
XAMPP comes bundled with PHP, Apache and MySQL preconfigured to work together and ready to go - just add water
Take a look at the section "Installation on windows machines" here: http://nl3.php.net/manual/en/mysql.installation.php
Especially the bit about libmysql.dll
hmm.. I'm still confused - I understand you have to manually enable the mysql extensions in PHP5 - I've done this with php_mysqli.dll and php_mysql.dll and am still having no luck.
How about libmysql.dll? Did you do anything to let PHP find that? Please read the link in my previous post.
I've read the link, apologies I should have said in the previous post - I've added the link to libmysql.dll in the Windows PATH settings.
Still no luck.
You know that you should put the path to the file in the windows PATH right, not just the file?
Also, for the PATH to take effect you need to reboot your system.
I added the PHP installation path in the Environment variables yes, I have also rebooted the system - I've followed the instructions exactly how they are on the page.
I uninstalled everything, php, apache, mysql - restarted my PC.
Set everything up again.
Still having the same problem - so now I'm officially stuck at this page in the tutorial because I can't get any sort of success with mysqli_connect in php.
at this stage then I think your best option, so you can at least get going again, is to install a local web server like xampp as suggested earlier.
Actually.. one question I wanted to ask - in the guide I'm following it states to rename a file called php.ini-dist in the PHP folder when setting up your php.ini file initially, however in my version of PHP this file didn't exist, there were 2 other files instead:
They both look similar, I've tried modifying both with the instructions in the guide and have had no luck - this wouldn't have something to do with my problem would it?