Troubles at the moment to install php5 with support for mysql4

Ryan Schmidt ryandesign at
Wed May 5 14:22:58 PDT 2010

On May 5, 2010, at 14:01, Bradley Giesbrecht wrote:

> On May 5, 2010, at 11:42 AM, edwin sandoval wrote:
>> Actually I have troubles at the moment to install php5 with support for mysql4:
>> sudo port install php5 +apache2 +mysql4 +php5-mysql +pear
>> --->  Computing dependencies for php5
>> --->  Fetching php5
>> --->  Verifying checksum(s) for php5
>> --->  Extracting php5
>> --->  Applying patches to php5
>> --->  Configuring php5
>> The +mysql4 variant is obsolete. Please install the php5-mysql port instead. <--- Here is the trouble

Where is the trouble? :) php5-mysql should have no trouble connecting to a MySQL 4 server.

>> --->  Building php5
>> --->  Staging php5 into destroot
>> Note: php5 installs files outside the common directory structure.
>> --->  Installing php5 @5.3.1_1+apache2+darwin_10+macosx+mysql4+pear
>> --->  Deactivating php5 @5.3.1_1+apache2+darwin_10+macosx+mysql5+pear
>> --->  Activating php5 @5.3.1_1+apache2+darwin_10+macosx+mysql4+pear

Unless you've backdated your php5 to 5.3.1_1 intentionally, your ports are out of date; php5 is currently at version 5.3.2_0. I recommend you "sudo port selfupdate" to get updated port definitions and "sudo port upgrade outdated" to upgrade your outdated ports.

>> I need to have in php5 support for databases with mysql4 because I have some DBs in this version.
>> Can any one help me?
> Ryan the maintainer of php5 will probably chime in but I will offer this in the mean time.
> You don't mention what version of mysql4 you need but the php5-mysql port defaults to variant +mysqlnd which uses the php 5.3 native drivers to connect to mysql 4.1 or newer.

Right. And if you need MySQL 4.0, you can use php5-mysql's +mysql4 variant instead. Hopefully you don't, though; MySQL 4 is ancient and even MySQL AB's extended support for it ended last year.

I'll probably want to delete all traces of mysql4 from MacPorts in the not too distant future. I suppose I should start with deleting all traces of mysql3 first, though. :)

> Try not to use pear because Ryan is hard at work creating all the pear classes as ports.

Well, not exactly...

> port search php5-*
> If you don't see the pear classes listed amoung the php5-* ports please request the ones you need.

Those are PECL ports, not PEAR ports. We could try to start creating PEAR ports, but we'd probably have to enhance the php5extension portgroup, or write a new portgroup; I'm not sure how PEAR modules get installed manually. I don't think I have the energy to deal with PEAR ports but if somebody else thought it was a good idea and wanted to be responsible for that, that would be ok.

You may be thinking of when I said that +pear variant of php5 should become a separate php5-pear port, going along with my general directive of removing variants from php5:

Actually I'd rather delete it entirely since pear is not very interesting to me, but probably somebody would complain about that. The problem is that using pear to install PHP stuff is just as bad as using CPAN to install perl stuff or gem to install Ruby stuff -- MacPorts doesn't know about the stuff that gets installed by those tools, and MacPorts really likes to be in control of everything installed in its prefix. The benefit of not offering any way to install pear (or cpan or gem) with MacPorts is that it would make it clear to the user that they're on their own in dealing with that software.

> So I something along the lines of this should get you what you want:
> sudo port install mysql4 +server

Only if you want to set up a new MySQL 4 server on the same computer as your web server. If you already have a MySQL 4 server running elsewhere that you just want to connect to, no need to do this.

> sudo port install php5
> sudo port install php5-mysql

More information about the macports-users mailing list