Solved

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

Posted on 2011-03-03
8
755 Views
Last Modified: 2012-05-11
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
Comment
Question by:cewi
8 Comments
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35032198
If you can't get it to work, try adodb. I use it for everything.
0
 
LVL 2

Expert Comment

by:garrett_boarder
ID: 35032252
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
 

Author Comment

by:cewi
ID: 35032283
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35032533
0
 

Author Comment

by:cewi
ID: 35032570
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
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 35033280
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
 

Accepted Solution

by:
cewi earned 0 total points
ID: 35180491
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
 

Author Closing Comment

by:cewi
ID: 35221132
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP AJAX JSON 2 61
Attach to file (img) a unique id 8 27
writing a post to a file that is on same folder and same webserver 5 31
TLS/SSL Diable 3DES ciper suites 4 30
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question