Solved

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

Posted on 2011-03-03
8
747 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
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35032533
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 108

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now