Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#28334 closed defect (invalid)

Dependency logic causes PHP upgrade to fail

Reported by: davidkarlin@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.9.2
Keywords: dependency installation Cc: ryandesign (Ryan Schmidt)
Port:

Description

Situation is this:

I had php5 v 5.3.2 installed.

I type port install php5-imap

Under the surface, and without telling me, this upgrades the base php5 to version 5.3.5.

Unfortunately, it fails to upgrade some of the other php5 components, which are installed as separate modules. I think the one that went wrong was php5-mysql (there were several others).

The result was an invalid copy of PHP, which broke Apache in an extremely improbable way: as soon as you made a call to PDO::fetch(), Apache would send a reply to the browser with status 200 but a blank file.

The macports system should not have permitted me to install a module without making me install all necessary upgrades first - even a warning (and I don't think there was one) isn't really enough.

Change History (3)

comment:1 Changed 10 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added
Component: portsbase
Port: php5 removed
Resolution: invalid
Status: newclosed

Use "sudo port selfupdate" to update your MacPorts base and your port definitions. At the end, it should tell you to then run "sudo port upgrade outdated", which you should then do; this will upgrade all your outdated ports. This should fix the issues you experienced. If this upgrade strategy is not satisfactory, please discuss on the macports-users mailing list what you think MacPorts should do instead.

comment:2 Changed 10 years ago by davidkarlin@…

Thanks for the impressively quick reply. I did run "sudo port selfupdate", but did not run "sudo port upgrade outdated", which I decided (perhaps unwisely, as it turned out) was too risky in terms of the danger of new bugs in upgraded versions. So I don't think the upgrade strategy is good enough, and I will do what you suggest and try to think of alternatives. If I come up with anything sensible, I'll put it on the macports-users mailing list.

comment:3 Changed 10 years ago by ryandesign (Ryan Schmidt)

Upgrading everything is safest in terms of making sure dependencies aren't suddenly broken, though as you say there is always the danger of new undiscovered bugs. If you're aware of what depends on what, you can be selective about what you upgrade. But certainly all your bundled php5 extensions must be the same version number as php5 itself. How do you know which php5 extensions are bundled and which aren't? Probably easiest is just looking at the version number -- if it's 5.3.something then it's probably bundled and should be upgraded to match the version of php5. You can also look in the extensions' portfiles themselves (using e.g. "port cat php5-whatever") -- bundled extensions have the word "bundled" at the end of the line that begins with "php5extension.setup".

Note: See TracTickets for help on using tickets.