Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix #17713 - Show clear error when SQL setup files are missing#20294

Open
predictor2718 wants to merge 1 commit into
phpmyadmin:masterfrom
predictor2718:fix/17713-sql-files-missing-error-master
Open

Fix #17713 - Show clear error when SQL setup files are missing#20294
predictor2718 wants to merge 1 commit into
phpmyadmin:masterfrom
predictor2718:fix/17713-sql-files-missing-error-master

Conversation

@predictor2718
Copy link
Copy Markdown
Contributor

@predictor2718 predictor2718 commented Apr 26, 2026

Closes #17713 (parallel of #20293 for master/6.0-dev — same fix at the new file paths).

When the user removes the resources/sql/ directory (per FAQ 1.44 to reduce
installed size on disk) and then clicks "Create" on the configuration-storage
prompt, Relation::getCreateTableSqlQueries() returns an empty array
(file_get_contents fails). Relation::fixPmaTables() then accessed
$createQueries[$table] which was undefined, ending up with
tryQuery(null, ...)TypeError, HTTP 500.

This patch:

  • Suppresses the file_get_contents warning when the SQL file is missing (the
    resources/sql/ directory is intentionally removable per FAQ).
  • Detects the empty-result case in fixPmaTables() and sets a clear message
    pointing the user at the missing directory, instead of crashing.

Verified end-to-end against MySQL 8 — clicking "Create" with the
resources/sql/ directory removed now shows
"Cannot create the phpMyAdmin configuration storage: the SQL setup files in
/…/resources/sql/ are missing. Please restore the directory from the
phpMyAdmin distribution." instead of an "Internal error: TypeError".

Error message after the fix:

issue17713-master-after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP error on try to create the phpmyadmin without SQL files on disk

1 participant