PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old June 2nd, 2006, 08:25 PM
ohnomatt ohnomatt is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 ohnomatt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ohnomatt
"call to undefined function mysql_connect()"

I’m a Windows XP user that’s having a problem getting PHP to interact with MySQL. I have Apache 2.2.2 and PHP 5.1.4, which are working together just fine, and MySQL 5 is running, but I cannot connect to my MySQL 5 server using the mysql_connect function. I get the “call to undefined function mysql_connect()” error. I do not see any info about MySQL on the page brought up by the phpinfo() function, which makes me think I haven’t managed to configure PHP to work with MySQL.

Things I’ve done so far:
-set the username and password for MySQL
-added the php directory to my windows PATH
-enabled the php_mysql.dll extension (and added a line to enable php_mysqli.dll) in php.ini (I’ve tried this with and without mysqli enabled, and tried the alternative connect function “mysqli_connect”, it doesn’t work either way)
-added the “ext” directory in PHP to the extension_dir line of the php.ini (which was renamed from php.ini-recommended).
-tried downloading and using the “libmysql.dll” and “php_mysql.dll” files from the MySQL website instead of using the ones that come with the PHP installation.
-downgraded to lower versions of Apache / PHP / MySQL (this gave me more problems as the php4apache2.dll didn’t seem to work with Apache2.2, and the 2.0 version of Apache confused me as to the location of the config file, etc).

I’ve restarted the computer and restarted the Apache server after any major config changes, etc… nothing has worked so far. The MySQL website was mentioning recompiling PHP to support MySQL, but I used the zip file and don’t know how to compile from source – I didn’t even know what a webserver was before a month ago. I’ll probably try using XAMPP again soon or some other package deal, but when I last used XAMPP it was giving me problems with creating a MySQL account for some reason.

Anyone have any suggestions? Sorry for the length but I wanted to try to be specific. Thanks in advance.

Reply With Quote
Old June 28th, 2006, 06:44 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,308 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 29
RE: "call to undefined function mysql_connect()"

I had the same problem and had done all of the things you mentioned, it was driving me nuts. After hours of messing with stuff, I found that the problem was that the extension_dir directive would not accept multiple paths separated by semicolons. One would think that since include_dir does accept multiple paths (there is in fact a commented example in php.ini-dist), extension_dir would too. But this isn't the case. So, if you have something like this:

extension_dir = ".;c:phpext"

change it to this:

extension_dir = "c:phpext"

Hope this helps

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > "call to undefined function mysql_connect()"


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap