Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Connecting MySQL and PHP (http://www.programmingforums.org/showthread.php?t=12873)

titaniumdecoy Mar 26th, 2007 2:21 AM

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.

PhilBon Mar 26th, 2007 3:14 AM

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.


titaniumdecoy Mar 26th, 2007 4:02 PM

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?

PhilBon Mar 26th, 2007 4:17 PM

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.

DaWei Mar 26th, 2007 4:38 PM

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.

Ooble Mar 26th, 2007 9:36 PM

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.

FERDIKUCUK Feb 18th, 2008 8:13 AM

Re: Connecting MySQL and PHP
 
Php and Mysql Connected

Sane Feb 18th, 2008 8:37 AM

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.

FERDIKUCUK Feb 18th, 2008 8:43 AM

Re: Connecting MySQL and PHP
 
dont look at the fault;
ı want to help

titaniumdecoy Feb 18th, 2008 3:15 PM

Re: Connecting MySQL and PHP
 
Well, you are definitely not helping by digging up year-old threads.


All times are GMT -5. The time now is 9:17 PM.

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