Q&A
OS: CentOS7.9
Apache: 2.4.6
DB: 10.9.3-MariaDB MariaDB-Server
php: 8.2.0
phpMyAdmin: 5.2.0
CentOS7.9にApacheとMariaDBの設定をした後、phpMyAdminの設定をしています。
設定完了後の最終確認で、以下のphpファイル(デフォルトでダウンロードされるphpMyAdminのログイン画面を表示するindex.phpです。)をブラウザで確認したときに正常に表示されない(真っ白になる)のですが、どういった原因が考えられるでしょうか?
同じファイルパス(ファイル名も同じにした場合)の他のphpファイルは正常に表示されるので、このphpファイルの中身の何かがエラーを起こしていると考えています。
<?php declare(strict_types=1); use PhpMyAdmin\Common; use PhpMyAdmin\Routing; if (! defined('ROOT_PATH')) { // phpcs:disable PSR1.Files.SideEffects define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR); // phpcs:enable } if (PHP_VERSION_ID < 70205) { die('<p>PHP 7.2.5+ is required.</p><p>Currently installed version is: ' . PHP_VERSION . '</p>'); } // phpcs:disable PSR1.Files.SideEffects define('PHPMYADMIN', true); // phpcs:enable require_once ROOT_PATH . 'libraries/constants.php'; /** * Activate autoloader */ if (! @is_readable(AUTOLOAD_FILE)) { die( '<p>File <samp>' . AUTOLOAD_FILE . '</samp> missing or not readable.</p>' . '<p>Most likely you did not run Composer to ' . '<a href="https://docs.phpmyadmin.net/en/latest/setup.html#installing-from-git">' . 'install library files</a>.</p>' ); } require AUTOLOAD_FILE; global $route, $containerBuilder, $request; Common::run(); $dispatcher = Routing::getDispatcher(); Routing::callControllerForRoute($request, $route, $dispatcher, $containerBuilder);
/var/log/httpd/error_log の内容は以下になります。
# cat /var/log/httpd/error_log [Tue Oct 11 09:19:37.285742 2022] [mpm_prefork:notice] [pid 4596] AH00170: caught SIGWINCH, shutting down gracefully [Tue Oct 11 09:19:38.337999 2022] [suexec:notice] [pid 5149] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Tue Oct 11 09:19:38.354650 2022] [lbmethod_heartbeat:notice] [pid 5149] AH02282: No slotmem from mod_heartmonitor [Tue Oct 11 09:19:38.380694 2022] [mpm_prefork:notice] [pid 5149] AH00163: Apache/2.4.6 (CentOS) PHP/8.2.0RC3 configured -- resuming normal operations [Tue Oct 11 09:19:38.380712 2022] [core:notice] [pid 5149] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
/etc/httpd/conf.d/phpmyadmin.conf の内容は以下になります。
(/home/www/html/pma をphpMyAdminのディレクトリにしています。)
Alias /pma /home/www/html/pma <Directory /home/www/html/pma> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 Require all granted </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory> <Directory /home/www/html/pma/setup/> <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory>
追記
phpとphpMyAdminをアンインストールし、以下のコマンドで再度インストールしました。
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm # yum install --enablerepo=remi,remi-php74 php php-devel php-mbstring php-mysqlnd php-pdo php-gd # yum install --enablerepo=remi,remi-php74 phpMyAdmin
これにより、php7.4とphpMyAdmin5.2.0が新しくインストールされました。
/etc/httpd/conf.d/phpMyAdmin.conf は以下のように編集しています。
Alias /pma /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin> AddDefaultCharset UTF-8 Require all granted </Directory> <Directory /usr/share/phpMyAdmin/setup/> Require local </Directory> <Directory /usr/share/phpMyAdmin/libraries/> Require all denied </Directory> <Directory /usr/share/phpMyAdmin/templates/> Require all denied </Directory> <Directory /usr/share/phpMyAdmin/setup/lib/> Require all denied </Directory> <Directory /usr/share/phpMyAdmin/setup/frames/> Require all denied </Directory>
ブラウザでhttp:xxx.xxx.xxx.xxx/pma/index.phpにアクセスしたところ、状況は変わらず真っ白で表示されています。
追記2
MariaDBに問題があるのかと思い、MariaDBをアンインストールした後にMySQLをインストールしましたが、状況は変わりませんでした。
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。