<bdo id='lAxbl'></bdo><ul id='lAxbl'></ul>

    <tfoot id='lAxbl'></tfoot>

    <small id='lAxbl'></small><noframes id='lAxbl'>

  1. <legend id='lAxbl'><style id='lAxbl'><dir id='lAxbl'><q id='lAxbl'></q></dir></style></legend>

    <i id='lAxbl'><tr id='lAxbl'><dt id='lAxbl'><q id='lAxbl'><span id='lAxbl'><b id='lAxbl'><form id='lAxbl'><ins id='lAxbl'></ins><ul id='lAxbl'></ul><sub id='lAxbl'></sub></form><legend id='lAxbl'></legend><bdo id='lAxbl'><pre id='lAxbl'><center id='lAxbl'></center></pre></bdo></b><th id='lAxbl'></th></span></q></dt></tr></i><div id='lAxbl'><tfoot id='lAxbl'></tfoot><dl id='lAxbl'><fieldset id='lAxbl'></fieldset></dl></div>

    1. 由于 PHP 版本,Apache 中的 PHPMyAdmin 500 内部服务器错误

      PHPMyAdmin 500 Internal Server Error in Apache due to PHP Version(由于 PHP 版本,Apache 中的 PHPMyAdmin 500 内部服务器错误)
    2. <i id='moMTn'><tr id='moMTn'><dt id='moMTn'><q id='moMTn'><span id='moMTn'><b id='moMTn'><form id='moMTn'><ins id='moMTn'></ins><ul id='moMTn'></ul><sub id='moMTn'></sub></form><legend id='moMTn'></legend><bdo id='moMTn'><pre id='moMTn'><center id='moMTn'></center></pre></bdo></b><th id='moMTn'></th></span></q></dt></tr></i><div id='moMTn'><tfoot id='moMTn'></tfoot><dl id='moMTn'><fieldset id='moMTn'></fieldset></dl></div>
        <tfoot id='moMTn'></tfoot>
      • <legend id='moMTn'><style id='moMTn'><dir id='moMTn'><q id='moMTn'></q></dir></style></legend>
          <tbody id='moMTn'></tbody>

        1. <small id='moMTn'></small><noframes id='moMTn'>

                <bdo id='moMTn'></bdo><ul id='moMTn'></ul>
                本文介绍了由于 PHP 版本,Apache 中的 PHPMyAdmin 500 内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                版本:

                • 操作系统 lsb_release -a:Ubuntu 18.04.5 LTS
                • PHP php -v : 8.0.1
                • Apache apache2 -v : 2.4.29 (Ubuntu)
                • MySQL mysql --version : mysql Ver 14.14 Distrib 5.7.32

                问题:

                我正在尝试使用以下 文章.但是,我在从浏览器访问 phpmyadmin 时遇到 HTTP 500 错误.

                并使用以下命令安装 phpmyadmin.

                • sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

                尝试过:

                所以,我检查了错误日志 tail -f/var/log/apache2/error.log 并发现 Phpmyadmin 运行在折旧版本的 PHP 上.

                [Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client103.25.169.179:28514] PHP 致命错误:数组和字符串偏移访问不再支持带花括号的语法/usr/share/phpmyadmin/libraries/Util.php 在线 2087[Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client 103.25.169.179:28514] PHP 致命错误:未捕获的 ValueError:mb_convert_encoding(): 参数 #2 ($to_encoding) 必须是有效的编码,"在/usr/share/php/php-php- 中给出gettext/gettext.inc:181
                堆栈跟踪:
                #0/usr/share/php/php-php-gettext/gettext.inc(181): mb_convert_encoding()
                #1/usr/share/php/php-php-gettext/gettext.inc(278): _encode()
                #2/usr/share/php/php-php-gettext/gettext.inc(285): _gettext()
                #3/usr/share/phpmyadmin/libraries/sanitizing.lib.php(179): __()
                #4/usr/share/phpmyadmin/libraries/Message.php(607): PMA_sanitize()
                #5/usr/share/phpmyadmin/libraries/Message.php(672):PMA\libraries\Message::decodeBB()
                #6/usr/share/phpmyadmin/libraries/Error.php(220): PMA\libraries\Message->getMessage()
                #7/usr/share/phpmyadmin/libraries/ErrorHandler.php(193):PMA\libraries\Error->getHash()
                #8/usr/share/phpmyadmin/libraries/ErrorHandler.php(156):PMA\libraries\ErrorHandler->addError()
                #9 [内部函数]:PMA\libraries\ErrorHandler->handleError()
                #10/usr/share/phpmyadmin/libraries/session.inc.php(133): ini_set()
                #11/usr/share/phpmyadmin/libraries/common.inc.php(280): require('...')
                #12/usr/share/phpmyadmin/index.php(13): require_once('...')
                #13 {main}
                在第 181 行的/usr/share/php/php-php-gettext/gettext.inc 中抛出

                • 我通过使用 [ ] 删除 { } 解决了数组和字符串偏移访问语法错误
                • 运行以下命令sudo phpenmod mbstring

                解决方案

                重要提示:

                如果您将 phpMyAdmin 公开或需要较新 phpMyAdmin 版本的功能,请更改版本号以获得更高的安全性.

                <块引用>

                这是从聊天中截取的.有些事情可能不准确,但这解决了 OP 的问题

                使用以下教程安装 PHPMyAdmin:

                1.

                apt purge phpmyadmin -y

                cd/path/to/somefolder

                wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0-rc1/phpMyAdmin-5.1.0-rc1-all-languages.zip &&解压 phpMyAdmin-5.1.0-rc1-all-languages.zip &&cd phpMyAdmin-5.1.0-rc1-all-languages

                apt install pwgen -y

                1. 记下此命令的输出,我将其称为pw

                pwgen -s 32 1

                cp config.sample.inc.php config.inc.php

                1. 使用喜欢的编辑器编辑 config.inc.php,并将 pw 粘贴到这一行:

                <预><代码>...$cfg['blowfish_secret'] = 'STRINGOFTHIRTYTWORANDOMCHARACTERS';/* 你必须填写这个以获得 cookie 身份验证!*/...

                vim/etc/apache2/conf-available/phpmyadmin-custom.conf

                1. 将以下内容粘贴到上一个命令中:

                别名/phpmyadmin/path/to/that/phpMyAdmin-5.1.0-rc1-all-languages<目录"/path/to/that/phpMyAdmin-5.1.0-rc1-all-languages>选项 SymLinksIfOwnerMatch目录索引 index.php要求所有授予</目录>

                1. 使用:wq保存上一个,运行以下命令

                a2enconf phpmyadmin-custom &&systemctl 重启 apache2 &&mysql

                1. your_password_here 替换为您自己的密码.

                ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password_here';

                systemctl restart mysql

                现在应该可以了.

                附加说明:

                要只允许您查看 phpMyAdmin,请尝试:

                <目录/path/to/that/phpMyAdmin-5.1.0-rc1-all-languages">选项 SymLinksIfOwnerMatch目录索引 index.php需要本地# 或者改成# 需要 ip 127.0.0.1# 将 127.0.0.1 更改为您的个人电脑 IP 地址,# 不给服务器ip# 如果你想从公共服务器访问phpMyAdmin,但不允许其他人访问它</目录>

                Version:

                • OS lsb_release -a : Ubuntu 18.04.5 LTS
                • PHP php -v : 8.0.1
                • Apache apache2 -v : 2.4.29 (Ubuntu)
                • MySQL mysql --version : mysql Ver 14.14 Distrib 5.7.32

                Problem:

                I'm trying to install LAMP Stack using following article. However, I was getting HTTP 500 Error while accessing phpmyadmin from browser.

                And installed phpmyadmin using below command.

                • sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

                Tried :

                So, I checked with Error Log tail -f /var/log/apache2/error.log and found that Phpmyadmin was running on depreciated version of PHP.

                [Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client 
                103.25.169.179:28514] PHP Fatal error:  Array and string offset access 
                syntax with curly braces is no longer supported in 
                /usr/share/phpmyadmin/libraries/Util.php on line 2087
                
                [Sat Jan 30 12:56:38.798871 2021] [php:error] [pid 17271] [client 103.25.169.179:28514] PHP Fatal error:  Uncaught ValueError: 
                mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid 
                encoding, "" given in /usr/share/php/php-php-
                gettext/gettext.inc:181
                Stack trace:
                #0 /usr/share/php/php-php-
                gettext/gettext.inc(181): mb_convert_encoding()
                #1 /usr/share/php/php-
                php-gettext/gettext.inc(278): _encode()
                #2 /usr/share/php/php-php-
                gettext/gettext.inc(285): _gettext()
                #3 
                /usr/share/phpmyadmin/libraries/sanitizing.lib.php(179): __()
                #4 
                /usr/share/phpmyadmin/libraries/Message.php(607): PMA_sanitize()
                #5 
                /usr/share/phpmyadmin/libraries/Message.php(672): 
                PMA\libraries\Message::decodeBB()
                #6 
                /usr/share/phpmyadmin/libraries/Error.php(220): PMA\libraries\Message-
                >getMessage()
                #7 /usr/share/phpmyadmin/libraries/ErrorHandler.php(193): 
                PMA\libraries\Error->getHash()
                #8 
                /usr/share/phpmyadmin/libraries/ErrorHandler.php(156): 
                PMA\libraries\ErrorHandler->addError()
                #9 [internal function]: 
                PMA\libraries\ErrorHandler->handleError()
                #10 
                /usr/share/phpmyadmin/libraries/session.inc.php(133): ini_set()
                #11 
                /usr/share/phpmyadmin/libraries/common.inc.php(280): require('...')
                #12 
                /usr/share/phpmyadmin/index.php(13): require_once('...')
                #13 {main}
                  
                thrown in /usr/share/php/php-php-gettext/gettext.inc on line 181
                
                

                • I'd solved Array and string offset access syntax error by removing { } with [ ]
                • Run the following command sudo phpenmod mbstring

                解决方案

                Important:

                Please change the version number to get more security if you have phpMyAdmin exposed to the public or need features from newer phpMyAdmin versions.

                This was taken from a chat. Some things might be inaccurate, but this solved the OP's problem

                Install PHPMyAdmin using the following tutorial:

                1.

                apt purge phpmyadmin -y
                

                cd /path/to/somefolder
                

                wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0-rc1/phpMyAdmin-5.1.0-rc1-all-languages.zip && unzip phpMyAdmin-5.1.0-rc1-all-languages.zip && 
                cd phpMyAdmin-5.1.0-rc1-all-languages
                

                apt install pwgen -y
                

                1. Make note of the output of this command, I will refer to it as pw

                pwgen -s 32 1
                

                cp config.sample.inc.php config.inc.php
                

                1. Edit config.inc.php with favorite editor, and paste the pw in this line:

                . . .
                $cfg['blowfish_secret'] = 'STRINGOFTHIRTYTWORANDOMCHARACTERS'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
                . . .
                

                vim /etc/apache2/conf-available/phpmyadmin-custom.conf
                

                1. Paste the following to that previous command:

                Alias /phpmyadmin /path/to/that/phpMyAdmin-5.1.0-rc1-all-languages
                <Directory "/path/to/that/phpMyAdmin-5.1.0-rc1-all-languages">
                Options SymLinksIfOwnerMatch
                DirectoryIndex index.php
                Require all granted
                </Directory>
                

                1. Save the previous one using :wq, Run the following command

                a2enconf phpmyadmin-custom && systemctl restart apache2 && mysql
                

                1. Replace your_password_here to your own password.

                ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password_here';
                

                systemctl restart mysql
                

                It should work now.

                Additional notes:

                To only allow you to view phpMyAdmin, try:

                <Directory "/path/to/that/phpMyAdmin-5.1.0-rc1-all-languages">
                Options SymLinksIfOwnerMatch
                DirectoryIndex index.php
                Require local
                # Or change it to
                # Require ip 127.0.0.1
                # change 127.0.0.1 to your personal computers ip address,
                # not to the server ip
                # if you want to access phpMyAdmin from a public server, but not allow others to access it
                </Directory>
                

                这篇关于由于 PHP 版本,Apache 中的 PHPMyAdmin 500 内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <tbody id='PA1pi'></tbody>

              • <small id='PA1pi'></small><noframes id='PA1pi'>

                    <i id='PA1pi'><tr id='PA1pi'><dt id='PA1pi'><q id='PA1pi'><span id='PA1pi'><b id='PA1pi'><form id='PA1pi'><ins id='PA1pi'></ins><ul id='PA1pi'></ul><sub id='PA1pi'></sub></form><legend id='PA1pi'></legend><bdo id='PA1pi'><pre id='PA1pi'><center id='PA1pi'></center></pre></bdo></b><th id='PA1pi'></th></span></q></dt></tr></i><div id='PA1pi'><tfoot id='PA1pi'></tfoot><dl id='PA1pi'><fieldset id='PA1pi'></fieldset></dl></div>
                      <bdo id='PA1pi'></bdo><ul id='PA1pi'></ul>
                          <legend id='PA1pi'><style id='PA1pi'><dir id='PA1pi'><q id='PA1pi'></q></dir></style></legend>

                          <tfoot id='PA1pi'></tfoot>