Add MySQL support to previously-installed (MacPorts) PHP4

Leez theleez at gmail.com
Thu Jan 13 15:06:30 PST 2011


Success!

I simply reinstalled php4 with mysq5 support,

"sudo install port php4 +mysql5"

and it left the previously-installed apache2 (and all other dependencies)
alone, rebuilding php4 with mysql5 support and installing mysql5.  It also
left all of my config (httpd.conf and php.ini) files intact, and was
therefore instantly interacting with my non-macports mysql server.  Exactly
what I wanted.

I have one last question for you.  To save disk space and keep things clean,
I'd like to uninstall the non-mysql php4.  What is the best way to do this?
If I "sudo uninstall port php4", will it know that I'm referring to the
first install solely by the omission of "+mysql5" and leave the current
build of php4 alone?

Thanks so much for taking the time to elaborate on my questions.  I have a
much better understanding of how MacPorts works.

∴ MacPorts is awesome.


On Thu, Jan 13, 2011 at 12:58, Ryan Schmidt <ryandesign at macports.org> wrote:

> 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!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110113/eb88aae9/attachment.html>


More information about the macports-users mailing list