![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
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. |
|
|
|
|
|
#2 | |
|
Hobbyist Programmer
|
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:
|
|
|
|
|
|
|
#3 |
|
Expert Programmer
|
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? |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
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.
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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.
|
|
|
|
|
|
#7 |
|
Php Coder
|
__________________
All in one programming Articles Site |
|
|
|
|
|
#8 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
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.
|
|
|
|
|
|
#9 |
|
Php Coder
|
Re: Connecting MySQL and PHP
dont look at the fault;
ı want to help
__________________
All in one programming Articles Site |
|
|
|
|
|
#10 |
|
Expert Programmer
|
Re: Connecting MySQL and PHP
Well, you are definitely not helping by digging up year-old threads.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|