Skip to content

Fix phpMyAdmin after opening Adminer - #4144

Merged
brandonpayton merged 7 commits into
trunkfrom
emdash/adminer-phpmyadmin-interference-f5ren
Jul 22, 2026
Merged

Fix phpMyAdmin after opening Adminer#4144
brandonpayton merged 7 commits into
trunkfrom
emdash/adminer-phpmyadmin-interference-f5ren

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 21, 2026

Copy link
Copy Markdown
Member

What problem does this fix?

The Database panel offers both Adminer and phpMyAdmin. phpMyAdmin opens when it is
used first, but it can fail after Adminer has opened on the same Playground site.

Playground can use a second PHP process when requests overlap. Each process starts
with its own in-memory filesystem, and Playground explicitly shares a few important
directories between them.

Adminer is installed inside the WordPress document root, which was already shared.
phpMyAdmin is installed under /tools/phpmyadmin, outside that root, and exposed by
the /phpmyadmin URL alias. A phpMyAdmin request handled by the second PHP process
therefore could not see the installed files.

How does the fix work?

/tools is Playground's filesystem boundary for tools installed at runtime. This
change adds that boundary to the standard directories shared with every secondary
PHP process, alongside /tmp, the WordPress document root, and Playground's
internal shared directories.

This is intentionally based on filesystem ownership rather than URL aliases. URL
aliases can point anywhere, so their parent depth cannot be inferred safely. An
earlier version mounted the exact /tools/phpmyadmin alias target. The full CI
suite showed that a nested mount interfered with recycled secondary web runtimes,
causing unrelated repeated proc_open() and shutdown-prefetch tests to hang. Using
the existing /tools boundary removes that nested mount and gives all runtime tools
the same consistent sharing rule.

The phpMyAdmin buttons also use the generated config.inc.php as the installation
marker. This prevents a partially created directory from being mistaken for a
complete installation.

Regression coverage

The browser test opens Adminer through the Database panel first, then opens
phpMyAdmin on the same site and confirms both tools can read the WordPress tables.
Its inline comment links back to this PR and explains why that order matters.

The previous static helper test was removed. It only repeated a configuration value
and could not catch the runtime failure; the browser sequence protects the actual
user-visible contract.

Development asset follow-up

While reproducing this in a worktree whose path contains a space, WordPress loaded
without CSS or JavaScript. This was a separate remote Vite configuration problem:
using URL.pathname left spaces encoded as %20, so Vite looked in a directory
that did not exist. The config now uses Node's fileURLToPath() to produce a valid
native filesystem path.

This only changes development asset resolution. Production asset URLs are
unchanged.

Validation

  • playground-remote unit tests: 38 passed.
  • playground-remote lint and typecheck: passed.
  • playground-remote production build: passed.
  • The two E2E scenarios that failed in CI now pass locally in Chromium:
    repeated proc_open(php) and shutdown loopback prefetch.
  • The Adminer-then-phpMyAdmin regression test passed in Chromium, Firefox, and
    WebKit in the previous CI run.

Manual test steps

  1. Start the site with npm run dev.
  2. Open a Playground and select Database.
  3. Click Open Adminer and confirm the wp_posts table is visible.
  4. Return to the Database panel and click Open phpMyAdmin.
  5. Confirm phpMyAdmin opens, is styled, and also shows wp_posts.

There are no intentional breaking API changes.


const path = (filename: string) => new URL(filename, import.meta.url).pathname;
const path = (filename: string) =>
fileURLToPath(new URL(filename, import.meta.url));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This fix was necessary to enable testing from a worktree with a space in its path.

@brandonpayton brandonpayton left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm leaving some comments for Codex.

Comment thread packages/playground/remote/src/lib/php-instance-shared-paths.ts Outdated
@brandonpayton
brandonpayton marked this pull request as ready for review July 22, 2026 16:13
@brandonpayton
brandonpayton requested review from a team, Copilot and zaerl July 22, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes a regression where phpMyAdmin can fail to open after Adminer on the same Playground site by ensuring runtime-installed tool files are shared across overlapping PHP processes, and adds an E2E regression test for the exact user flow.

Changes:

  • Share /tools between PHP instances so secondary processes can see runtime-installed phpMyAdmin files.
  • Use config.inc.php as the phpMyAdmin “installed” marker instead of just checking for the directory.
  • Add a Playwright regression test covering “Open Adminer” then “Open phpMyAdmin”, and fix dev asset path resolution for worktrees containing spaces.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/playground/website/src/components/site-manager/site-database-panel/phpmyadmin-button.tsx Detect installation via config.inc.php marker.
packages/playground/website/playwright/e2e/website-ui.spec.ts Adds regression E2E test for Adminer → phpMyAdmin flow.
packages/playground/tools/src/phpmyadmin/index.ts Centralizes phpMyAdmin config path constant and uses it during install.
packages/playground/remote/vite.config.ts Fixes dev path resolution for spaces using fileURLToPath().
packages/playground/remote/src/lib/playground-worker-endpoint.ts Shares /tools boundary across PHP instances.
packages/playground/personal-wp/src/components/site-manager/site-database-panel/phpmyadmin-button.tsx Mirrors install detection via config.inc.php marker.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/website/playwright/e2e/website-ui.spec.ts Outdated
Comment thread packages/playground/website/playwright/e2e/website-ui.spec.ts Outdated
Comment thread packages/playground/website/playwright/e2e/website-ui.spec.ts
Comment thread packages/playground/remote/vite.config.ts
@brandonpayton

Copy link
Copy Markdown
Member Author

This reads fine and tests well. Let's merge.

I did notice there is a problem opening phpMyAdmin within Personal WP, but that also exists on trunk. An agent is looking into that issue now.

@brandonpayton
brandonpayton merged commit 087352c into trunk Jul 22, 2026
53 checks passed
@brandonpayton
brandonpayton deleted the emdash/adminer-phpmyadmin-interference-f5ren branch July 22, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment