你好,我知道有很多关于这个问题的问题,但问题是我安装了 apache2 和 mysql 和 php 7.3 但是当我尝试输入 localhost/phpmyadmin 它显示
?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Main loader script
*
* @package PhpMyAdmin
*/
use PhpMyAdmin\Charsets;
use PhpMyAdmin\Config;
use PhpMyAdmin\Core;
use PhpMyAdmin\Display\GitRevision;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\Message;
use PhpMyAdmin\RecentFavoriteTable;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Server\Select;
use PhpMyAdmin\ThemeManager;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use PhpMyAdmin\UserPreferences;
/**
* Gets some core libraries and displays a top message if required
*/
require_once 'libraries/common.inc.php';
/**
* pass variables to child pages
*/
$drops = array(
'lang',
'server',
'collation_connection',
'db',
'table'
);
foreach ($drops as $each_drop) {
if (array_key_exists($each_drop, $_GET)) {
unset($_GET[$each_drop]);
}
}
unset($drops, $each_drop);
/*
* Black list of all scripts to which front-end must submit data.
* Such scripts must not be loaded on home page.
*
*/
$target_blacklist = array (
'import.php', 'export.php'
);
// If we have a valid target, let's load that script instead
if (! empty($_REQUEST['target'])
&& is_string($_REQUEST['target'])
&& ! preg_match('/^index/', $_REQUEST['target'])
&& ! in_array($_REQUEST['target'], $target_blacklist)
&& Core::checkPageValidity($_REQUEST['target'], [], true)
) {
include $_REQUEST['target'];
exit;
}
if (isset($_REQUEST['ajax_request']) && ! empty($_REQUEST['access_time'])) {
exit;
}.....etc
这是一个很长的代码,所以我不会全部包含它,除非你问我发生了什么是在安装了所有 Lamp 服务之后我输入了 php 我的管理员然后它抛出了 not found 所以我将这一行包含在 apache 配置中
Include /etc/phpmyadmin/apache.conf
然后这发生了
ubuntu 版本:Ubuntu 20.04 LTS 我将它下载为桌面
我如何安装 LAMP https://medium.com/better-programming/how-to-install-lamp-stack-on-ubuntu-db77ac018116
但请注意,并非一切工作都完美,有一些错误,我不得不检查其他资源,我进入了许多网站并在来到这里之前尝试了很多东西,所以如果你建议重新安装所有东西,我的环境可能会很糟糕,请指导我完成整个过程
更新: 我安装了 php 7.4.3,但我认为它没有启用,当我尝试时
a2enmod php7.4
它抛出
Considering dependency mpm_prefork for php7.4:
Considering conflict mpm_event for mpm_prefork:
ERROR: Module mpm_event is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Considering conflict mpm_worker for mpm_prefork:
ERROR: Could not enable dependency mpm_prefork for php7.4, aborting
php cli 是 7.4.3 apache 日志
[Mon Apr 27 06:04:22.301065 2020] [mpm_event:notice] [pid 7212:tid 140619563371584] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Mon Apr 27 06:04:22.301385 2020] [core:notice] [pid 7212:tid 140619563371584] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 27 06:05:42.547129 2020] [mpm_event:notice] [pid 7212:tid 140619563371584] AH00491: caught SIGTERM, shutting down
[Mon Apr 27 06:06:08.849938 2020] [mpm_event:notice] [pid 8424:tid 140393719311424] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Mon Apr 27 06:06:08.850056 2020] [core:notice] [pid 8424:tid 140393719311424] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 27 06:08:59.234468 2020] [mpm_event:notice] [pid 8424:tid 140393719311424] AH00493: SIGUSR1 received. Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Mon Apr 27 06:08:59.242099 2020] [mpm_event:notice] [pid 8424:tid 140393719311424] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Mon Apr 27 06:08:59.242111 2020] [core:notice] [pid 8424:tid 140393719311424] AH00094: Command line: '/usr/sbin/apache2'
[Mon Apr 27 06:09:07.878703 2020] [mpm_event:notice] [pid 8424:tid 140393719311424] AH00491: caught SIGTERM, shutting down
[Mon Apr 27 15:40:17.496415 2020] [mpm_event:notice] [pid 971:tid 140557889219648] AH00489: Apache/2.4.41 (Ubuntu) configured -- resuming normal operations
[Mon Apr 27 15:40:17.549391 2020] [core:notice] [pid 971:tid 140557889219648] AH00094: Command line: '/usr/sbin/apache2'
关于 phpinfotest 它显示了源代码
没有这样的文件 /etc/apache2/site-available/your_vhost.conf
我与此类似的是/etc/apache2/sites-available/000-default.conf
您需要检查PHP、您的Host、您的Vhost、您的Apache日志
检查您的CLI
检查您的Apache日志
使用phpinfo()在浏览器 ( localhost/test.php ) 中检查PHP
将此代码粘贴到test.php中
检查您的本地主机或新的本地域名
检查您的虚拟主机
如果一切正常,请尝试检查您的phpmyadmin是否已启用
启用 mod 或站点后很重要...重新启动或重新加载apache
我通过卸载所有 apache2 、 mysql 、 phpmyadmin 、 php来解决这个问题
使用突触包管理器,您可以使用此链接安装它
https://dev.to/xeroxism/how-to-install-synaptic-package-manager-in-ubuntu-linux-hm3and
卸载所有组件后,我按照这个人的教程
https://www.youtube.com/watch?v=TNwCGttYrlM
如果找不到通过包的终端,那么您查看错误并解决问题,然后按照视频的建议进行操作,如果输入http://localhost/phpmyadmin时提示找不到 phpmyadmin,则 phpmyadmin 将与您一起工作
那么你应该编辑这个文件
并将此行添加到任何地方,如您发现为空的任何行的第 79 行
保存并重新启动apache
希望这对将来的任何人都有帮助,祝你好运