Skip to content

Commit 520583c

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2 parents b4e2cc7 + b5fb37b commit 520583c

4 files changed

Lines changed: 44 additions & 4 deletions

File tree

docs/faq.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,27 @@ can be set to use the older authentication with a command such as
725725
726726
.. seealso:: <https://github.com/phpmyadmin/phpmyadmin/issues/14220>, <https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0>, <https://bugs.php.net/bug.php?id=76243>
727727

728+
.. _faq1_46:
729+
730+
1.46 Missing ``HTTP_HOST`` variable when using nginx with HTTP/3
731+
-----------------------------------------------------------------------------------------------------------
732+
733+
When using phpMyAdmin with nginx and HTTP/3 enabled, the ``HTTP_HOST`` variable may be missing due to a known issue with nginx's HTTP/3 implementation, which can cause several issues:
734+
735+
- Two-factor authentication won't work
736+
- Exported settings have no hostname in the filename (e.g., ``phpMyAdmin-config-.json``)
737+
- The hostname is missing from the page title (empty ``@HTTP_HOST@``)
738+
739+
To fix this issue, add the following line to your nginx configuration:
740+
741+
.. code-block:: nginx
742+
743+
fastcgi_param HTTP_HOST $host;
744+
745+
This line should be placed in the server block of your nginx configuration where the PHP-FPM settings are defined.
746+
747+
.. seealso:: <https://github.com/php/php-src/issues/13021>, <https://github.com/nginx/nginx/issues/455>, <https://trac.nginx.org/nginx/ticket/2281>, <https://mailman.nginx.org/pipermail/nginx-devel/2024-January/3CQEHII5QU2BTQ7L7DAVCBWK3OQS3GU6.html>
748+
728749
.. _faqconfig:
729750

730751
Configuration

phpstan-baseline.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15114,6 +15114,12 @@ parameters:
1511415114
count: 2
1511515115
path: src/Utils/HttpRequest.php
1511615116

15117+
-
15118+
message: '#^Used function http_get_last_response_headers not found\.$#'
15119+
identifier: function.notFound
15120+
count: 1
15121+
path: src/Utils/HttpRequest.php
15122+
1511715123
-
1511815124
message: '''
1511915125
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:

psalm-baseline.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5692,17 +5692,14 @@
56925692
<code><![CDATA[$this->method]]></code>
56935693
<code><![CDATA[$this->name]]></code>
56945694
</MixedAssignment>
5695-
<PossiblyNullArrayOffset>
5696-
<code><![CDATA[$partitionMap]]></code>
5697-
<code><![CDATA[$partitionMap]]></code>
5698-
</PossiblyNullArrayOffset>
56995695
<PossiblyUnusedMethod>
57005696
<code><![CDATA[getDescription]]></code>
57015697
<code><![CDATA[getSubPartitions]]></code>
57025698
<code><![CDATA[hasSubPartitions]]></code>
57035699
</PossiblyUnusedMethod>
57045700
<RiskyTruthyFalsyComparison>
57055701
<code><![CDATA[$dbi->fetchValue('SELECT @@have_partitioning;')]]></code>
5702+
<code><![CDATA[empty($row['PARTITION_NAME'])]]></code>
57065703
<code><![CDATA[empty($row['SUBPARTITION_NAME'])]]></code>
57075704
</RiskyTruthyFalsyComparison>
57085705
</file>

src/Controllers/HomeController.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use PhpMyAdmin\Charsets;
1010
use PhpMyAdmin\Config;
1111
use PhpMyAdmin\ConfigStorage\Relation;
12+
use PhpMyAdmin\Core;
1213
use PhpMyAdmin\Current;
1314
use PhpMyAdmin\Dbal\DatabaseInterface;
1415
use PhpMyAdmin\Favorites\RecentFavoriteTables;
@@ -394,6 +395,21 @@ private function checkRequirements(): void
394395
];
395396
}
396397

398+
/**
399+
* Check for missing HTTP_HOST
400+
* This commonly occurs with nginx >= 1.25.0 and HTTP/3 configurations
401+
*/
402+
if (Core::getEnv('HTTP_HOST') === '') {
403+
$this->errors[] = [
404+
'message' => __(
405+
'The [code]HTTP_HOST[/code] variable is missing,'
406+
. ' which might cause phpMyAdmin to not work properly.'
407+
. ' Please refer to [doc@faq1-46]documentation[/doc] for possible issues.',
408+
),
409+
'severity' => 'warning',
410+
];
411+
}
412+
397413
$this->checkLanguageStats();
398414
}
399415

0 commit comments

Comments
 (0)