Add MySQL support to previously-installed (MacPorts) PHP4

Ryan Schmidt ryandesign at macports.org
Thu Jan 13 12:58:48 PST 2011


I'm sending this reply back to the mailing list so others can benefit from the discussion. Remember to Reply All (not just Reply).


On Jan 13, 2011, at 14:20, Leez wrote:

> Thanks Ryan.  A couple questions:
> 
> I originally installed php4 with "sudo install port php4" which installs apache2 as a dependency, and I am currently using that install of apache2.  Do I need to reinstall apache2 as well?

No, apache2 doesn't need to be reinstalled, and won't be, just by reinstalling php4.


> If not, will +no_web leave my apache install alone?

Using php4's +no_web variant will install php4 without any web server support; that's probably not what you want. You probably want to retain the apache2 support in php4. So you'll ultimately want to install php4 with both the +mysql5 and +apache2 variants. In this case, you don't actually have to manually specify the apache2 variant, though, because the php4 port knows most people want the apache2 variant and turns it on for you automatically (unless you ask for the +no_web variant). But you can be explicit in your request if you want to, i.e. "sudo port install php4 +apache2 +mysql5"


> Do I need to uninstall php4 (and all the dependencies) before installing, or will the install script recognize what's there and make the changes?

When you ask MacPorts to install a port with a new set of variants, it will deactivate your existing installation of that port for you, and then install and activate the new one. You can later uninstall the mysql5-less php4 if desired to free up disk space.

With the exception of the addition of the mysql5 dependency, php4's dependencies won't change, so you don't need to (and shouldn't) uninstall them (and MacPorts would prevent you from doing so).


> Does the +mysql5 variant actually install mysql?

Yes, php4's mysql5 support requires the MySQL client libraries, so it will install the MacPorts mysql5 port to provide those.


> If so, will it mess with my other (non-macport) install,

No, it won't affect your non-MacPorts MySQL server.


> and can I just uninstall it with "port uninstall mysql5" after?

No, you can't uninstall it; it provides the MySQL client libraries php4 needs in order to communicate with a MySQL server.


> Thanks again, and sorry if my questions are elementary -- in case you couldn't tell, I'm new to macports.

Welcome to MacPorts!




More information about the macports-users mailing list