當我安裝 Php、PhpMyAdmin 和 Nginx 時,我用這些代碼檔案收到了這個檔案,而不是訪問
http://localhost:80/phpmyadmin
<?php
declare(strict_types=1);
use PhpMyAdmin\Routing;
if (! defined('ROOT_PATH')) {
// phpcs:disable PSR1.Files.SideEffects
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
// phpcs:enable
}
global $route, $containerBuilder;
require_once ROOT_PATH . 'libraries/common.inc.php';
$dispatcher = Routing::getDispatcher();
Routing::callControllerForRoute($route, $dispatcher, $containerBuilder);
我已經 在 nginx 中完成了這個 phpmyadmin 404 錯誤 來修復 404 錯誤,但之后我收到了上面的錯誤。對不起,我的英語不好。
uj5u.com熱心網友回復:
第 1 步:您需要使用命令列檢查 nginx 服務器的狀態:
sudo service nginx status
- 如果 nginx 服務器未激活,請嘗試使用命令列重新啟動 nginx 服務器
sudo service nginx restart - 如果您看到失敗,讓我們檢查埠 80 上正在運行的程式(讓我知道在評論中)。常見錯誤是 apache2 服務器在 80 埠上運行引起的(如果是,請轉到下一步)。
第 2 步:為您提供兩種解決方案 1,使用此逗號行停止服務器 apache2:
sudo service apache2 stop
重啟 nginx 服務器:
sudo service nginx restart
再次檢查狀態 nginx 服務器,現在應該可以了。2、更改埠 apache2 你需要更改兩個檔案/etc/httpd/conf/httpd.conf和/etc/apache2/ports.conf
例如,我將埠 apache2 從 80 更改為 8888:
sudo nano /etc/apache2/ports.conf并更改Listen 80為Listen 8888
sudo nano /etc/apache2/ports.conf并更改<VirtualHost: *:80>為<VirtualHost: *:8080>
之后,重啟apache2服務器和nginx服務器:
重啟apache2服務器:
sudo service apache2 restart重啟 nginx 服務器:
sudo service nginx restart
如果您有什么想問的,請發表評論。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/507308.html
標籤:php ubuntu nginx phpmyadmin
