UFO ET IT

phpmyadmin이 포함 된 PHP 7은 많은 지원 중단 알림을 제공합니다.

ufoet 2020. 12. 13. 10:02
반응형

phpmyadmin이 포함 된 PHP 7은 많은 지원 중단 알림을 제공합니다.


나는이 우분투 16.04 LTS가 실행 PHP7 및 phpMyAdmin을 설치했다. 그러나 다음과 같은 많은 지원 중단 알림이 표시됩니다.

Deprecation Notice in ./../php/php-gettext/streams.php#48  
Methods with the same name as their class will not be constructors in a future version of PHP; StringReader has a deprecated constructor

Backtrace  
./../php/php-gettext/gettext.inc#41: require()  
./libraries/select_lang.lib.php#477: require_once(./../php/php-gettext/gettext.inc)  
./libraries/common.inc.php#569: require(./libraries/select_lang.lib.php)  
./index.php#12: require_once(./libraries/common.inc.php)

이것이 문제입니까? 이러한 알림을 제거하려면 어떻게해야합니까 (페이지가로드되거나 작업이 수행 될 때마다 팝업 됨)?


나는이 문제가 있었고 phpmyadmin과 그 종속성을 간단히 다시 설치하여 해결했습니다. 다음 명령을 실행하십시오.

sudo apt-get remove --purge phpmyadmin php-gettext php-mbstring -y
sudo apt-get autoremove -y
sudo apt-get update
sudo apt-get install phpmyadmin php-gettext php-mbstring -y

다시 설치하면 새 제품이 될 것입니다!


이 문제를 해결 한 방법 은 16.04 phpmyadmin의 감가 상각 통지 오류에서 askubuntu 지침을 따르는 것 입니다. /usr/share/php/php-gettext/streams.php에서 세 줄을 변경하고 /usr/share/php/php-gettext/gettext.php에서 한 줄을 변경하는 작업이 포함됩니다.

해당 링크에서 수행해야 할 변경 사항은 다음과 같습니다 (우분투 16.04가있는 경우).

sudo nano /usr/share/php/php-gettext/streams.php

48 행 StringReader 오류입니다.

52 호선으로 갈아 타세요

function StringReader ($str='') {

function __construct($str='') {

84 행 FileReader 오류

90 번 라인으로 이동하여 변경

function FileReader($filename) {

...에

function __construct($filename) {

145 행 CacheFileReader 오류

146 호선으로 이동하여 변경

function CachedFileReader($filename) {

...에

function __construct($filename) {

사용 sudo nano /usr/share/php/php-gettext/gettext.php.

36 행 gettext_reader {오류

이제 요점을 알 것 같아요 101 번 줄로 가서 변경

function gettext_reader($Reader, $enable_cache = true) {

function __construct($Reader, $enable_cache = true) {

phpmyadmin에 다른 PPA를 사용할 수 있습니다. 여기에 PPA 링크가 있습니다.

sudo add-apt-repository ppa:nijel/phpmyadmin
sudo apt update
sudo apt install phpmyadmin

임시 솔루션이거나 최적의 솔루션이 아니기 때문에 우분투 저장소의 phpmyadmin 패키지가 다시 빌드 될 때까지.


php.ini에서 error_reporting = ~ E_DEPRECATED를 설정해야합니다. 그러면 지원 중단 오류가 제거됩니다. 와 비슷해야합니다 error_reporting = ~E_DEPRECATED & E_ALL. 작동하는지 알려주세요.


친애하는 @BeniaminPantiru 귀하의 대답은 정확하지만 Apache에 오류를 수정하는 대신 사용 중단 오류를 표시하지 않도록 지시하기 때문에 솔루션이 문제를 해결하지 못합니다. 하지만 필요한 보안 업데이트 및 패키지를 업그레이드하여이 오류를 쉽게 수정할 수 있습니다. 다음 명령을 입력하면 문제가 해결됩니다.

sudo apt-get dist-upgrade

사용중인 phpMyAdmin 버전이나 설치된 위치에 대해서는 언급하지 않았지만 Ubuntu 패키지 버전 4.5.4.1 또는 소스에서 지원되지 않는 오래된 버전 인 것 같습니다. 어느 쪽이든, https://github.com/phpmyadmin/phpmyadmin/issues/11462 에서 문제가보고 (및 수정)되었다고 생각합니다 . Ubuntu 패키지 버전을 사용하는 경우 거기에있는 의견은 nijel PPA 버전을 제안합니다. 당신을 위해 더 잘 작동 할 것입니다.

물론 Beniamin Pantiru의 대답도 좋습니다. 프로덕션 서버를 실행하는 경우 표준 모범 사례로 PHP에 표시되는 경고 및 오류 수를 줄여야합니다.


php.ini 파일 경로 /etc/php/7.0에서 오류보고를 다음과 같이 설정하여 수정했습니다.

error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR

일반적인 가치 :

 E_ALL (Show all errors, warnings and notices including coding standards.)

 E_ALL & ~E_NOTICE  (Show all errors, except for notices)

 E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)

 E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)

 Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED

나는 같은 문제가 있었다. phpmyadmin을 제거하고 다시 설치하기 전에 언급하고 싶었습니다. Apache를 다시 시작하십시오. 제 경우에는 가장 간단한 방법이었고 먼저 시도했습니다. 사람들이 시간을 절약하기를 원했습니다.

 sudo service apache2 restart

서버 업데이트는 sudo apt-get dist-upgrade로 나를 위해 일한 다음 아파치를 다시 시작했습니다.

이 문제는 phpmyadmin을 자주 업데이트하지 않아서 발생한다고 생각합니다.


Until it gets resolved in dependency itself (in your case the php-gettext) and you don't want to change global PHP settings so that your other stuff is not affected you may want to try to just customize PHPMyadmin's index.php by putting

error_reporting( ~E_DEPRECATED & E_ALL );

somewhere at the beginning or by using

php_value error_reporting 24575

in either .htdocs or virtual host configuration directive. I think the latter option is better.


The problem is caused by outdated PHP Class Constructor syntax. To fix this issue run the following code on your terminal:

sed -ri.bak 's:function StringReader.*:function __construct($str=\x27\x27) {:' /usr/share/php/php-gettext/streams.php
sed -ri 's:function FileReader.*:function __construct($filename) {:' /usr/share/php/php-gettext/streams.php
sed -ri 's:function CachedFileReader.*:function __construct($filename) {:' /usr/share/php/php-gettext/streams.php
sed -ri.bak 's:function gettext_reader.*:function __construct($Reader, $enable_cache = true) {:' /usr/share/php/php-gettext/gettext.php

I solved this issue differently in that i downloaded the official package from a newer Ubuntu:

https://packages.ubuntu.com/search?keywords=phpmyadmin

And then installed it:

sudo dpkg -i phpmyadmin_4.6.6-5_all.deb

Thus one doesn't have to use unofficial repositories and the package will simply be updated later on.


"Deprecation Notice" message on login page of phpMyAdmin

Ok, this issue solved easily with editing the php.ini file :

file path: /etc/php/7.0/apache2/php.ini

Change error_reporting value to:

CODE: SELECT ALL

error_reporting = ~E_DEPRECATED & E_ALL.   

By default it is on comment position, so uncomment it and change it.

Then restart Apache:

# systemctl restart apache2

OR Second Solution

apt-get purge phpmyadmin

apt-get install phpmyadmin

IF Require Then Install

apt-get install php7.0-mbstring

Then restart Apache:

# systemctl restart apache2

Well, the "Deprecation Notice" message no longer shows.


Problem arises when there's a mismatch between the original PHP version you were running previously and your current PHP server version. Depending on your installed PHP version, this should be enough.

sudo apt-get update
sudo apt-get install phpmyadmin php7.0-gettext php7.0-mbstring -y

I do not want to mess with the php installations, therefore I just restarted my Apache and it worked perfectly for me.

"sudo service apache2 restart"

One more thing for the top answer; need to add

Include /etc/phpmyadmin/apache.conf

to

/etc/apache2/apache2.conf

and restart Apache:

/etc/init.d/apache2 restart

at last I solved this problem permanently.

Find your php.ini file in your server. It should be in /etc/php/7.0/apache2 folder

open it with nano

nano /etc/php/7.0/apache2/php.ini

Find (ctrl+w) upload_max_filesize = 2M (default) in php.ini file

change default value to 50M or 100M or 20M as you wish.

Save and restart apache2 service

service apache2 restart

and please tell me your satisfactions :-)


restarting the server helped me

shutdown -r now

참고URL : https://stackoverflow.com/questions/37002494/php-7-with-phpmyadmin-gives-lots-of-deprecation-notices

반응형