Require PHP >= 8.0 due to Symfony stack incompatibilities

Bug #2016016 reported by William Desportes
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
phpmyadmin (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Confirmed
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

The lack of PHP < 8 support in Ubuntu's Symfony due to the Ubuntu PSR stack delta makes phpmyadmin crash when users try to run it through unsupported (non-Ubuntu) versions of PHP < 8 (See LP: #1975892).

This led to several complaints in the upstream channels

    - See: https://github.com/phpmyadmin/phpmyadmin/issues/17503
    - See: https://github.com/phpmyadmin/phpmyadmin/issues/17523 (same as above but with the hate/heat enabled)

[ Test Plan ]

From a clean ll/kk/jj install:

- Install phpmyadmin (no need to setup a DB)
# apt update
# apt install -y phpmyadmin libapache2-mod-php

- Configure apache2
# echo 'Include /etc/phpmyadmin/apache.conf' >> /etc/apache2/apache2.conf
# systemctl restart apache2

- Verify the login page in http://localhost/phpmyadmin/ displays a login page.

- Install PHP 7.4 (you can use Onrej Sury's PPA for this purpose)
# add-apt-repository ppa:ondrej/php
# apt update
# apt install -y php7.4

- Run phpmyadmin with the custom php 7.4
# a2dismod php8.1
# a2enmod php7.4
# systemctl restart apache2

- Verify the login page in http://localhost/phpmyadmin/ is now blank. You should also see an error in your apache logs pointing to Symfony, such as "[php7:error] ... PHP Parse error: syntax error, unexpected 'static' (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 27

- Install the proposed version of phpmyadmin (the fix provided here)

- Run phpmyadmin with the custom php 7.4

- Verify the login page in http://localhost/phpmyadmin/ is no longer blank. Instead of the blank page, you should now get a message informing you that you are running PHP < 8 and should use PHP >= 8 to run phpmyadmin.

- For completeness, you can verify that the package still works with php8. disable the php7.4 apache module and re-enable the php8.1 one.
# a2dismod php7.4
# a2enmod php8.1
# systemctl restart apache2

- Then verify that http://localhost/phpmyadmin/ displays the login page again.

[ Where problems could occur ]

Users with custom environments, using a third party PHP < 8 version and a third party PSR/symfony stack (non-Ubuntu) would experience a regression here. Their phpmyadmin installation would go from a functional state to a "gracefully halting" one.

This should not be a major issue given such users would be running an unsupported customization of our stack. The workaround for such users would be to consume phpmyadmin from a different source.

[ Other Info ]

While this SRU is proposing to fix a customized workflow (i.e., Ubuntu's PHP users are not affected here), there is a large user base consuming the PHP interpreter from third party sources. Therefore it would be nice from us to let them know this workflow is currently unsupported. This would also reduce the burden on the upstream project, as shown above.

Also, see: https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/2013402

Related branches

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, William.

Would you mind also providing a patch to get this fixed in lunar? We can SRU it in there as well (the current patch for jammy does not apply in lunar for this specific case. From all the SRUs you filed, I believe this is the only patch missing in Lunar.

The reason we want this fixed in lunar (and kinetic as well) is to avoid regressions when users upgrade from one series to a greater one (e.g., from Jammy to kinetic).

Revision history for this message
William Desportes (williamdes) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff for lunar" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
William Desportes (williamdes) wrote :

Hi Athos,

> The reason we want this fixed in lunar (and kinetic as well) is to avoid regressions when users upgrade from one series to a greater one (e.g., from Jammy to kinetic).

Makes sense.

> Would you mind also providing a patch to get this fixed in lunar?

Sure, I uploaded the debdiff here.

Revision history for this message
William Desportes (williamdes) wrote :
description: updated
summary: - [SRU] require PHP 8 (LP: #1975892)
+ Require PHP >= 8.0 due to Symfony stack incompatibilities
Revision history for this message
Robie Basak (racb) wrote :

I've added this to the SRU team agenda for discussion with the SRU team.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Robie!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package phpmyadmin - 4:5.2.1+dfsg-1ubuntu1

---------------
phpmyadmin (4:5.2.1+dfsg-1ubuntu1) mantic; urgency=medium

  * Require PHP >= 8.0 (LP: #2016016)

 -- William Desportes <email address hidden> Fri, 14 Apr 2023 18:11:15 +0200

Changed in phpmyadmin (Ubuntu):
status: New → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello William, or anyone else affected,

Accepted phpmyadmin into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/phpmyadmin/4:5.2.1+dfsg-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in phpmyadmin (Ubuntu Lunar):
status: New → Fix Committed
tags: added: verification-needed verification-needed-lunar
Revision history for this message
Steve Langasek (vorlon) wrote : Proposed package upload rejected

An upload of phpmyadmin to kinetic-proposed has been rejected from the upload queue for the following reason: "incomplete Recommends fix (LP: #2016017)".

Revision history for this message
Steve Langasek (vorlon) wrote :

An upload of phpmyadmin to jammy-proposed has been rejected from the upload queue for the following reason: "incomplete Recommends fix (LP: #2016017)".

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phpmyadmin (Ubuntu Jammy):
status: New → Confirmed
Changed in phpmyadmin (Ubuntu Kinetic):
status: New → Confirmed
Changed in phpmyadmin (Ubuntu Kinetic):
status: Confirmed → Won't Fix
Revision history for this message
William Desportes (williamdes) wrote :

> Accepted phpmyadmin into lunar-proposed.

Tested, and I can confirm the patch for PHP 8 is working as expected.

tags: added: verification-done-lunar
removed: verification-needed-lunar
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Re-uploaded the jammy fix without the recommends patch.

Changed in phpmyadmin (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

ppa:ondrej/php does not have lunar builds, is there another easy way to install php7.4 on lunar to test this bug and the fix?

Revision history for this message
William Desportes (williamdes) wrote :

Yes, install it even if it's not supported then edit the source list to use focal.
If you use the jammy out out of jammy it will segfault.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Hi Andreas,

For verifying this specific SRU on lunar, using the php7.4 binaries from the Ondrej's PPA mentioned in the Test Plan is enough, in the sense that we get the expected outcomes.

For that, I followed the test plan as it is described. On the "installing php7.4" step, I edited the repository file to point to ondrej's jammy PPA.

# cat /etc/apt/sources.list.d/ondrej-ubuntu-php-lunar.list
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main

This will successfully install php7.4 in lunar, and despite the fact that it is linked against some jammy libraries, it can successfully start phpmyadmin for the purposes of following the listed test plan.

I first verified I could reproduce the bug in lunar, getting the login page with php 8, and then the blank page described in the test plan when using php 7.

Then, I installed phpmyadmin from -proposed, to get the following text in http://localhost/phpmyadmin/ instead of a blank or the login page:

"""
PHP 8.0.0+ is required (Ubuntu Launchpad bug #1975892 and phpMyAdmin issue #17503).

Currently installed version is: 7.4.33
"""

Finally, I followed the "For completeness" steps in the test plan to run phpmyadmin through php 8 (with both php versions co-installed) and was able to see the login page again.

Hence, this looks good to me (verified).

Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for phpmyadmin has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package phpmyadmin - 4:5.2.1+dfsg-1ubuntu0.1

---------------
phpmyadmin (4:5.2.1+dfsg-1ubuntu0.1) lunar; urgency=medium

  [ William Desportes ]
  * Require PHP >= 8.0 (LP: #2016016)

  [ Athos Ribeiro ]
  * d/NEWS: document new behavior when running PHP < 8

 -- William Desportes <email address hidden> Fri, 14 Apr 2023 18:11:15 +0200

Changed in phpmyadmin (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello William, or anyone else affected,

Accepted phpmyadmin into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/phpmyadmin/4:5.1.1+dfsg1-5ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in phpmyadmin (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
description: updated
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

I installed and configured phpmyadmin 4:5.1.1+dfsg1-5ubuntu1 as suggested in the test plan above.
I could browse to the phpmyadmin login page successfully.
Then, I installed php7.4 from ondrej's ppa; disabled the php8.1 apache2 module and enable the php7.4 one.
Now, browding to the php login page, I got the blank screen as expected.

I also got the expected error in the apache2 error logs:

[php7:error] ... PHP Parse error: syntax error, unexpected 'static' (T_STATIC) in /usr/share/php/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 272

Then, I installed phpmyadmin 4:5.1.1+dfsg1-5ubuntu1.1 from the -proposed pocked.

Refreshing the phpmyadmin login page, I now get the following message in the page:
"
PHP 8.0.0+ is required (Ubuntu Launchpad bug #1975892 and phpMyAdmin issue #17503).

Currently installed version is: 7.4.33
"

Finally, switching back to the php8.1 apache2 module, the login page loads successfully.

This should be enough to verify this one.

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Chris Halse Rogers (raof) wrote : Proposed package removed from archive

The version of phpmyadmin in the proposed pocket of Jammy that was purported to fix this bug report has been removed because one or more bugs that were to be fixed by the upload have failed verification and been in this state for more than 10 days.

Changed in phpmyadmin (Ubuntu Jammy):
status: Fix Committed → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.