Shizzle

My little notebook

How to deactivate one macport variant and switch to another one

January 25, 2009

Lets say for instance you have installed PHP with MySQL support with macports:

sudo port install php5 +mysql5

But later on you decide you want to use SQLite, too, you’ll have to rebuild PHP with SQLite extensions, like this.

sudo port install php5 +mysql5 +sqlite

Now you have to deactivate the MySQL-only build and activate the one with SQLite bindings. I couldn’t find it anywhere in in the macports manual so here it goes.

Get a list of your current PHP5 builds with

$ sudo port activate php5
Password:
---> The following versions of php5 are currently installed:
---> php5 @5.2.8_1+apache2+macosx
---> php5 @5.2.8_1+apache2+macosx+mysql5 (active)
---> php5 @5.2.8_1+apache2+macosx+mysql5+sqlite
Error: port activate failed: Registry error: Please specify the full version as recorded in the port registry.

Then copy and paste the currently activated port and use the deactivate command.

sudo port deactivate php5 @5.2.8_1+apache2+macosx+mysql5
---> Deactivating php5 @5.2.8_1+apache2+macosx+mysql5

Then copy and paste the one you would like to use and use the activate command:

sudo port activate php5 @5.2.8_1+apache2+macosx+mysql5+sqlite
---> Activating php5 @5.2.8_1+apache2+macosx+mysql5+sqlite

That’s it.

Filed under: Mixed

1 Comment

  1. ObamAnon says:

    OMG, thanks for posting this, I could not find this anywhere, your solution is elegant. Five internetz to you, sir.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">