Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sub-URI support based on config option PMA_SUB_URI_BASE #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
fishermans wants to merge 2 commits into phpmyadmin:master
base: master
Choose a base branch
Loading
from fishermans:master

Conversation

Copy link

@fishermans fishermans commented Feb 11, 2022
edited
Loading

To support docker container behind a reverse proxy I added a new optional config option to simply running PMA under a sub-URI based on approach posted on Stackoverflow: https://stackoverflow.com/questions/42035947/how-to-change-the-access-url-of-official-phpmyadmin-docker-image-to-http-local/68643939#68643939

It simply creates a symlink inside the www folder.

williamdes reacted with eyes emoji
Copy link
Member

Hi @fishermans
I appreciate the effort for the feature, I can not agree with using the PMA prefix since this is not a phpMyAdmin setting but some virtual config trick only available in docker :)
Could you find another name?

@J0WI what do you think about this PR?
Will it be accepted in official Docker images?

Copy link
Author

Hi @fishermans I appreciate the effort for the feature, I can not agree with using the PMA prefix since this is not a phpMyAdmin setting but some virtual config trick only available in docker :) Could you find another name?

@J0WI what do you think about this PR? Will it be accepted in official Docker images?

Hi @williamdes,
It is of course possible to change this name as you like. Please just suggest a name and I will change the PR.
I thought that the variable should be similar to the other variables, so that it can be distinguished from your own ones. But I personally don't care at all what it should be called. The main thing is that you can start a PMA in Docker under a sub-URI in no time without having to create your own images.
BR

williamdes and marketerat1 reacted with thumbs up emoji

Copy link
Author

Maybe it is also possible to support sub-URI in general in PMA, for Docker and for native installations. If you do not have a wildcard certificate for your domain and working at a company where you have to ask other people to help you... sub-URI is very welcome.

Something like https://www.php.net/manual/en/function.symlink.php should also work. But I am not an export in PHP as you know what I mean. The ENTRYPOINT "hack" was simple to implement and is easy to maintain.

@@ -151,6 +195,7 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma
* ``PMA_PORTS`` - define comma separated list of ports of the MySQL servers
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username and password to use only with the `config` authentication method
* ``PMA_ABSOLUTE_URI`` - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration. Don't set this unless needed. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_PmaAbsoluteUri).
* ``PMA_SUB_URI_BASE`` - the URL suffix to phpMyAdmin when running on sub-URI like `your.domain.local/pma`. Syntax: `/<sub-uri>`.
Copy link
Member

@williamdes williamdes Apr 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this can not be called PMA_SUB_URI_BASE starting with PMA_ means it is a phpMyAdmin config option

Maybe URL_BASE ?

# See: https://stackoverflow.com/questions/42035947/how-to-change-the-access-url-of-official-phpmyadmin-docker-image-to-http-local/68643939#68643939
if [ -n "${PMA_SUB_URI_BASE}" ]; then
echo "Using sub URI: ${PMA_SUB_URI_BASE}."
# Create symlink if link target does not already exit.
Copy link

@dhanyn10singapay dhanyn10singapay Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create symlink if link target does not already exit.

@williamdes williamdes marked this pull request as draft January 7, 2025 21:39
@phpmyadmin phpmyadmin deleted a comment Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@williamdes williamdes williamdes left review comments

@ibennetch ibennetch Awaiting requested review from ibennetch

+1 more reviewer

@dhanyn10singapay dhanyn10singapay dhanyn10singapay left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /