Windows php.ini fails to load

System:
Windows 7 Pro 64 bit
PHP 5.3.5 installed in C:\PHP
MySQL 5.5.8 installed in E:\Program Files\MySQL
Apache 2.2.17 installed in E:\Program Files (x86)\Apache Software Foundation\Apache2.2

When attempting to connect to Mysql a fatal error message is returned:
Call to undefined function mysqliconnect() in E:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2
The calling code is $link = mysqliconnect(‘localhost’, ‘root’, ‘password’);
Calling phpinfo(); shows that :
Configuration File (php.ini) Path = C:\Windows
Loaded Configuration File = (none)
Although php.ini is in C:\Windows it appears that the configuration file is not being loaded.
I would appreciate any insight how I might get this to load.
TIA

Make sure you have the mysqli extension present and enabled in your php.ini, the error hints that mysqli isn’t available. phpinfo() will show a mysqli section if mysqli is working properly.

Thanks for your response.

The mysqli extension is present and located in C:\PHP\ext. It is enabled in php.ini.

I agree that mysqli is not being made available. As I said in my OP I don’t think php.ini is being loaded.

phpinfo() does not show a mysqli section but does show a mysqlnd section.

Any further suggestions will be much appreciated.

Note that there is supposed to be an underscore in the function name: mysqli_connect

Does that fix things?

Thanks for the response.

Unfortunately, it was my typo when posting to this forum.

In the calling code it is mysqli_connect, so, regrettably it does not fix things.

There are lots of ways to tell php where to locate the php.ini file. Since this forum is about PHP on Microsoft Web Platform, I’ll assume that you are using PHP with FastCGI. Open up the FastCGI configuration file (normally C:\WINDOWS\system32\inetsrv\fcgiext.ini), locate the PHP section and add this line:

Arguments=-c C:\\php\\php.ini

The whole section might look something like:


```php

ExePath=C:\\php\\php-cgi.exe
Arguments=-c C:\\php\\php.ini
.
.
.

Restart IIS and load the phpinfo page.

Alternately it is possible to specify php.ini path via windows registry or environment variables. See this page: http://www.php.net/manual/en/configuration.file.php

Thanks for your response.

As I stated in the OP, Apache is being used not IIS, so configuring fcgiext.ini is not appropriate here.

The directory path C:\PHP is set in the PHPRC environment variable but it seems that php.ini is not being read.

Maybe some permissions are set wrong. You can check that the user account apache is using can read the necessary php files and directories.

Apache can read the php files and directory. Both PHP and mySQL function independently of one another but PHP will not connect to MySQL.

Given the error generated, I do not think that php.ini is being loaded properly, but cannot fathom why this should be.