?
Solved

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

Posted on 2011-03-03
8
Medium Priority
?
768 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 39

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 39

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 111

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

752 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