PHP 7 with phpmyadmin gives lots of Deprecation Notices

前端 未结 20 1278
失恋的感觉
失恋的感觉 2020-12-12 13:16

I have Ubuntu 16.04 LTS running with PHP7 and phpmyadmin installed. However, I get a lot of deprecation notices like:

Depre         


        
相关标签:
20条回答
  • 2020-12-12 13:22

    You didn't mention which version of phpMyAdmin you're using or from where it was installed, but it seems to either be the Ubuntu packaged version 4.5.4.1 or a rather old and unsupported version from source. Either way, I believe your issue was reported (and fixed) at https://github.com/phpmyadmin/phpmyadmin/issues/11462 -- if you're using the Ubuntu packaged version, the comments there suggest that the nijel PPA version should work better for you.

    Of course, Beniamin Pantiru's accepted answer is good, too, and if you're running a production server you should reduce the number of warnings and errors displayed by PHP anyway as a standard best practice.

    0 讨论(0)
  • 2020-12-12 13:25

    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
    
    0 讨论(0)
  • 2020-12-12 13:25

    I had the same problem and none of the solution proposed here worked.

    My configuration was Ubuntu 16.04 and php 7.

    I solved the issue reinstalling phpmyadmin to last version (5.02). The process is pretty simple. Backup your phpmyadmin folder ('/usr/share/phpmyadmin/' to '/usr/share/phpmyadmin.bak/') by renaming it, create another folder '/usr/share/phpmyadmin/', download the last version of phpmyadmin and copy files inside the newly created folder '/usr/share/phpmyadmin/'. Your version is now upgraded. In my case, deprecation notice vanished.

    The process could raise a pair of other errors that you can get rid of by following this guide https://devanswers.co/manually-upgrade-phpmyadmin/

    0 讨论(0)
  • 2020-12-12 13:27

    Updating the server worked for me with sudo apt-get dist-upgrade and then restarting apache.

    I think that this issue is caused by not updating phpmyadmin frequently enough.

    0 讨论(0)
  • 2020-12-12 13:28

    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 :-)

    0 讨论(0)
  • 2020-12-12 13:31

    Dear @BeniaminPantiru your answer is correct but your solution is not solve the problem because you are telling the Apache to don't show the deprecation errors rather than fix the errors. but we can easily fix this error by upgrade the necessary security updates and packages. type the following command will solve the problem.

    sudo apt-get dist-upgrade
    
    0 讨论(0)
提交回复
热议问题