Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 26th, 2007, 2:21 AM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 841
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Connecting MySQL and PHP

Hi,

I installed PHP 5 and MySQL separately on my mac. However, it seems the folks behind PHP decided to disable MySQL by default, and no longer bundle the MySQL library with PHP. See here.

As I have already installed MySQL, it would seem all I need to do is configure PHP with the --with-mysql=/path/to/mysql option. However, I have already installed PHP and would like to avoid having to reinstall it.

Is there any way to modify my existing PHP 5 installation to recognize MySQL, or do I need to reinstall it? If I must reinstall it, is it necessary to delete the current installation first, and how would I go about doing that?

Thanks for your help.
titaniumdecoy is offline   Reply With Quote
Old Mar 26th, 2007, 3:14 AM   #2
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
There is a file for PHP that has a list of all the modules/Libraries, and there is one line that is about MySQL and you just have to uncomment it I believe, possibly providing that location (or placing the library/module in a certain directory). I'd look in the php directory where php is installed for something like Conf or Config, etc. From the php site you will need to download the library.
Quote:
Originally Posted by http://us2.php.net/mysql
MySQL is not enabled by default, nor is the MySQL library bundled with PHP... You can download headers and libraries from » MySQL.
PhilBon is offline   Reply With Quote
Old Mar 26th, 2007, 4:02 PM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 841
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Thanks for the input. I couldn't figure out how to do what you suggested, so I ended up reinstalling PHP with the --with-mysql option. It works fine now.

By the way, is anyone familiar with mysqli (MySQL Improved Extension) and is it worth installing?
titaniumdecoy is offline   Reply With Quote
Old Mar 26th, 2007, 4:17 PM   #4
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
sorry what I said couldn't help. I haven't installed PHP on a Mac and I don't know how the server is setup for it.
PhilBon is offline   Reply With Quote
Old Mar 26th, 2007, 4:38 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Mysqli was designed for PHP 4.1 and later, I believe. It's what I used when I installed a couple years ago. I have no idea what the details are regarding the difference.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 26th, 2007, 9:36 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I'd recommend MacPorts. Just type sudo port install php5 +apache2+mysql5 (if you want to add/remove functionality from this, type port variants php5 and change as needed), and sit back and wait.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 18th, 2008, 8:13 AM   #7
FERDIKUCUK
Php Coder
 
Join Date: Feb 2008
Posts: 5
Rep Power: 0 FERDIKUCUK is on a distinguished road
Send a message via MSN to FERDIKUCUK
Arrow Re: Connecting MySQL and PHP

Php and Mysql Connected
FERDIKUCUK is offline   Reply With Quote
Old Feb 18th, 2008, 8:37 AM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,825
Rep Power: 5 Sane will become famous soon enough
Re: Connecting MySQL and PHP

Dude. It's been a year since anyone has replied to this topic. Such threads are considered "dead", and shouldn't be revived, unless the conversation isn't yet over.
Sane is offline   Reply With Quote
Old Feb 18th, 2008, 8:43 AM   #9
FERDIKUCUK
Php Coder
 
Join Date: Feb 2008
Posts: 5
Rep Power: 0 FERDIKUCUK is on a distinguished road
Send a message via MSN to FERDIKUCUK
Re: Connecting MySQL and PHP

dont look at the fault;
ı want to help
FERDIKUCUK is offline   Reply With Quote
Old Feb 18th, 2008, 3:15 PM   #10
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 841
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Re: Connecting MySQL and PHP

Well, you are definitely not helping by digging up year-old threads.
titaniumdecoy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC