Opened 14 years ago

Closed 14 years ago

#22808 closed defect (worksforme)

PHP 5.3.1 bug breaks MediaWiki and no clear way to install PHP 5.3.0

Reported by: niels.olson@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc: blb@…, ryandesign (Ryan Carsten Schmidt), jyrkiwahlstedt
Port: php5 mediawiki

Description

I upgraded to Snow Leopard and had to reinstall MacPorts. Everything works except PHP 5.3.1 broke the navbox templates in my mediawiki install, which I happen to get from svn trunk. So Tim Starling and Aryeh Gregor from Wikimedia were able to confirm it really is a bug in PHP 5.3.1 (http://bugs.php.net/bug.php?id=50394).

Now my issue is that I want to revert back to PHP 5.3.0, but I don't see how to do that. I tried installing port php52 +postgresql84 but php failed to build.

Change History (14)

comment:1 Changed 14 years ago by niels.olson@…

Cc: niels.olson@… added

Cc Me!

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Cc: blb@… ryandesign@… jwa@… added; niels.olson@… removed
Keywords: php5 revert removed

comment:3 in reply to:  description Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to niels.olson@…:

I tried installing port php52 +postgresql84 but php failed to build.

This works for me. What error do you get?

comment:4 Changed 14 years ago by niels.olson@…

mediawiki consistently protested that php had been installed without postgres functions and asked if I had compiled --with-pgsql.

To be fair, I installed and uninstalled php5 and php52 several times last night. Now, in the light of the morning sun, it appears I never ran a pristine "port php52 +postgresql84". The closest was when I had hacked sources.conf to include a local svn repo of php 5.2.10 pulled from macports svn.

I'll try again tonight. Right now need to get to work.

comment:5 Changed 14 years ago by niels.olson@…

===========
First go
===========

$ apache2ctl stop
$ sudo port install php52 +postgresql84
...
Activating php52 @5.2.11_1+apache2+darwin_10+macosx
$ sudo port install php5-postgresql
...
Activating php5-postgresql @5.3.1_0+postgresql84
$ apache2ctl start

(Can't contact the database server: Postgres functions missing, have you compiled PHP with the --with-pgsql option? (Note: if you recently installed PHP, you may need to restart your webserver and database) )

===========
Second go
===========
hypothesis: maybe I can point php5-postgresql to build to the correct 5.2.11 version of php

$ apache2ctl stop
$ sudo port uninstall php5-postgresql php52
$ sudo port clean php5-postgresql php52
$ sudo port install php52 +postgresql84 php5-postgresql @5.2.11_1+apache2+darwin_10+macosx
...
Activating php52 @5.2.11_1+apache2+darwin_10+macosx
...
Activating php5-postgresql @5.3.1_0+postgresql84 <== so obviously my hypothesis was wrong, but I'll press on
$ apache2ctl start

(Can't contact the database server: Postgres functions missing, have you compiled PHP with the --with-pgsql option? (Note: if you recently installed PHP, you may need to restart your webserver and database) )

===========
Third go
===========
$ apache2ctl stop
$ sudo port uninstall php5-postgresql php52
$ sudo port clean php5-postgresql php52
$ sudo port install mediawiki +postgresql84
...
Activating php5 @5.3.1_0+apache2+darwin_10+macosx
...
Activating php5-postgresql @5.3.1_0+postgresql84
...
Activating php5-web @5.3.0_0
...
Activating mediawiki @1.15.1_1+postgresql+postgresql84


and now mediawiki from svn runs just fine except for the bug (http://bugs.php.net/bug.php?id=50394). As above, I am not using the macports mediawiki, I'm using mediawiki from svn. It just seems that installing mediawiki +postgresql84 through macports is the only way to get a version of php that runs mediawiki with postgres at all.

comment:6 in reply to:  5 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to niels.olson@…:

$ sudo port install php52 +postgresql84
...
Activating php52 @5.2.11_1+apache2+darwin_10+macosx
$ sudo port install php5-postgresql
...
Activating php5-postgresql @5.3.1_0+postgresql84

After the release of PHP 5.3.0 I began splitting PHP features into separate module ports like php5-postgresql. The version of these ports must be matched to the version of the php5 port. php5-postgresql is for use with php5 only. It does not work with php52. For php52, use the variants in the php52 port to add features.

hypothesis: maybe I can point php5-postgresql to build to the correct 5.2.11 version of php

No, php5-postgresql is for php5 only, not for php52.

$ sudo port install php52 +postgresql84 php5-postgresql @5.2.11_1+apache2+darwin_10+macosx

Yes, using the +postgresql84 variant of the php52 port is the correct thing to do.

Activating php52 @5.2.11_1+apache2+darwin_10+macosx

But here you see you have not after all selected the +postgresql84 variant.

The correct command to use is

sudo port install php52 +postgresql84

(and add any other variants you want; see port variants php52 for the list of available features).

As above, I am not using the macports mediawiki, I'm using mediawiki from svn. It just seems that installing mediawiki +postgresql84 through macports is the only way to get a version of php that runs mediawiki with postgres at all.

You should be able to use the mediawiki port with PHP 5.2.x, if desired, after you've installed the php52 port with postgresql support.

comment:7 Changed 14 years ago by niels.olson@…

Thanks. Seems I was mistaken on one count all along: there is no postgresql84 variant for the php52 port :-)

comment:8 in reply to:  7 ; Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to niels.olson@…:

there is no postgresql84 variant for the php52 port :-)

Oops, you're right! I've added it for you in r61279.

comment:9 in reply to:  8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

Replying to niels.olson@…:

there is no postgresql84 variant for the php52 port :-)

Oops, you're right! I've added it for you in r61279.

Modernized the PostgreSQL variants in php4 for good measure in r61284.

comment:10 Changed 14 years ago by niels.olson@…

thanks, man, works like a champ.

comment:11 Changed 14 years ago by niels.olson@…

grrrrr .... I spoke to soon. After clearing cache, something isn't right with the navboxes, in fact, it looks exactly like it did under php 5.3.1 with a not-very-pretty work-around to the parser bug that initially prompted this whole attempt to downgrade in macports. This seems weird, doesn't it? Everything is hunky-dory with

$sudo port install postgresql83-server php52 +postgresql83 +apache2 +tidy +fastcgi +debug +gmp +pear

but the navboxes are broken with this

$sudo port install php52 +postgresql84 +apache2 +tidy +fastcgi +debug +gmp +pear
...
To use the postgresql server, install the postgresql84-server port
...
$sudo port install postgresql84-server

Why would the postgresql variant have anything to do with how php handles __call() functions?

comment:12 in reply to:  11 ; Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

After the release of PHP 5.3.0 I began splitting PHP features into separate module ports like php5-postgresql. The version of these ports must be matched to the version of the php5 port. php5-postgresql is for use with php5 only.

As of r61490, the bundled extensions enforce this requirement.

Replying to niels.olson@…:

Why would the postgresql variant have anything to do with how php handles __call() functions?

I can't think of a reason why that would be the case.

comment:13 in reply to:  12 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

As of r61490, the bundled extensions enforce this requirement.

Make that as of r61501.

comment:14 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: worksforme
Status: newclosed

I'm going to close this. The question in the title of the ticket (how to install an older version of a port) was answered by providing a referral to the howto article in the wiki, and any other remaining bugs likely need to be reported to the developers of the software in question (e.g. php or mediawiki).

Note: See TracTickets for help on using tickets.