Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 794
  • Last Modified:

can't get iis7 & php to connect to mysql server

scenario:

Windows 2008 (32bit) server
php 5.3.5
iis 7
php is working
mysql is located on another server
mysql extensions are uncommented in the php.ini config file.  

problem:
My web server won't connect to the mysql server.

Fatal error: Call to undefined function mysql_connect()

I've copied the libmysql.dll from the old server and copied it to c:\php & c:\php\ext & the system32 directories.  no luck.  

I created a test file that runs .....


<pre><?php echo function_exists('mysql_connect') ? 'YES' : 'NO';
print_r(get_defined_functions()); ?></pre>

and it returns no mysql functions at all.

Thanks in advance for the help/
0
cewi
Asked:
cewi
1 Solution
 
Aaron TomoskyTechnology ConsultantCommented:
If you can't get it to work, try adodb. I use it for everything.
0
 
garrett_boarderCommented:
You may have to allow MySQL connections from another IP in MySQL config.  I am guessing it is just localhost by default for security reasons.
0
 
cewiAuthor Commented:
the mysql server is setup to accept connections.  I have another site that connects to it (coldfusion) and I also tried to connect the php site to the old sql server which i knows works.  

mysql_connect should be a predefined function in php.  is it not on my server.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Aaron TomoskyTechnology ConsultantCommented:
0
 
cewiAuthor Commented:
thanks for the info but that is a tutorial with vista, php 5.1, and mysql installed locally.  that is not my setup.  i've already followed several setup guides for my scenario.
0
 
Ray PaseurCommented:
When you run the phpinfo() function do you see that MySQL is installed?  IIRC it is a separate installation, not part of the PHP core.
0
 
cewiAuthor Commented:
I figured out the problem (somewhat).  The config file was pointing to the correct extensions directory however phpinfo showed it was pointing to the root of the php folder and i couldn't change it.  After a uninstall and re-install it is working correctly. thanks
0
 
cewiAuthor Commented:
I am giving the grade of B b/c I couldn't figure out the cause of PHP defaulting the extensions directory.  It had to be fixed with a reinstall.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now