PHP 7 with phpmyadmin gives lots of Deprecation Notices

前端 未结 20 1281
失恋的感觉
失恋的感觉 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:31

    I had the same problem. I just wanted to mention that before purging phpmyadmin and reinstalling it. Try restarting Apache. In my case it was the simplest approach and I tried it first. I just wanted people to save time.

     sudo service apache2 restart
    
    0 讨论(0)
  • 2020-12-12 13:32

    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.

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

    For PHP 7.3+

    Edit the following file : config.inc.php. It can be located in /etc/phpmyadmin/config.inc.php or in /usr/share/phpmyadmin/config.inc.php

    /**
     * Whether or not to query the user before sending the error report to
     * the phpMyAdmin team when a JavaScript error occurs
     *
     * Available options
     * ('ask' | 'always' | 'never')
     * default = 'ask'
     */
    
    $cfg['SendErrorReports'] = 'never';
    
    0 讨论(0)
  • 2020-12-12 13:32

    "Deprecation Notice" message on login page of phpMyAdmin

    Ok, this issue solved easily with editing /etc/php/7.0/apache2/php.ini

    Change error_reporting value to:

    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.

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

    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.

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

    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
    
    0 讨论(0)
提交回复
热议问题