Apache and PHP on one machine, MySQL server on another

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
kww
Forum Newbie
Posts: 2
Joined: Tue Jun 22, 2010 10:18 pm

Apache and PHP on one machine, MySQL server on another

Post by kww »

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. I would like to be able to connect to my remote SQL server. I just can't get the PHP interpreter on the Windows 7 machine 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. 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?
kww
Forum Newbie
Posts: 2
Joined: Tue Jun 22, 2010 10:18 pm

Re: Apache and PHP on one machine, MySQL server on another

Post by kww »

I've also copied the libmysql.dll file from the MySQL installation package into the PHP directory (and the extension directory). No luck.
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: Apache and PHP on one machine, MySQL server on another

Post by Doug G »

I don't have any problems running a local php application on my workstation that uses my hosting company mysql db. As long as your code specifies the correct host (by IP, URL) and the mysql server allows remote access and you don't have any firewalls blocking the connection it should work ok.
Post Reply