Jump to content

Yet another "Cannot find mysqli_init" question


kww

Recommended Posts

I gave up trying to install MySQL on my Windows 7 machine. Hours of fiddling, and it never could install properly. So, I uninstalled it, and installed it on my Windows XP machine where it seems to be running happily, waiting for someone to connect to it.

 

On my main Windows 7 64-bit machine, I am running Apache Web Server and PHP 5.3.2. I would like to be able to connect to my remote SQL server. I just can't get it to recognize the function calls related to SQL.

 

My php.ini file has

 

extension_dir="C:\Program Files (x86)\PHP\ext"

 

[php_MYSQLI]

extension=php_mysqli.dll

 

I've verified that php_mysqli.dll is in that directory, and I don't get any error messages starting PHP. I verified my PATH variable. It successfully does the basic "Hello World" level stuff. However, when trying to access the mysqli functions, I get:

Fatal error: Call to undefined function mysqli_init() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\sqlconnect4.php on line 8

 

Most installation guides I find assume that I have MySQL installed locally. Is there something special I need to do to deal with the remote server?

 

 

Link to comment
Share on other sites

Found it, plus a new bug, but I'll open a separate thread for that. This one was nasty. I found out that if I ran PHP by itself on the command line, it could find the SQL functions. It only couldn't when loaded from Apache. Turns out my httpd.conf file was wrong. If it cannot load the file pointed to by PHPIniDir it fails silently. I had an error in it, so PHP was loading without a .ini file, and all the changes I made to mine were ineffective.

 

LoadModule php5_module "C:/Program Files (x86)/PHP/php5apache2_2.dll"

AddHandler application/x-httpd-php .php

 

# configure the path to php.ini

PHPIniDir "C:/Program Files (x86)/PHP/" ; was just "C:/PHP"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.