phpmyadmin deprecation notice php 8
Asked Answered
K

9

10

After upgrading phpmyadmin lots of warnings and notices is being shown while running any task. errors is shown below.

Deprecation Notice in .\vendor\twig\twig\src\Loader\FilesystemLoader.php#40 realpath(): Passing null to parameter #1 ($path) of type string is deprecated

Deprecation Notice in .\vendor\twig\twig\src\Markup.php#35

Return type of Twig\Markup::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Deprecation Notice in .\libraries\classes\Util.php#1936

Function strftime() is deprecated

Kerrin answered 19/5, 2022 at 11:43 Comment(3)
You upgraded PHP or PHPMyAdmin?Conquer
yes I upgrade phpmyadmin from 5.4 to 8.0 and my php version is 8.1 when I change php version from 8.1 to 7.4 errors were disappeared.Kerrin
There is no phpmyadmin 8.0 or even 5.4. The latest version currently is 5.2 (as of May 11, 2022).Eupatorium
E
24

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

$cfg['SendErrorReports'] = 'never';
Enterectomy answered 28/7, 2022 at 9:48 Comment(4)
Yes it solved the problem of the deprecation warning always showing, thanks. But the question is, is it really solve the problem, or just hiding it?Buhl
I agree with the comment above. It hides all of the errors but it doesn't solve the issueAveri
I agree with Muhammad's comment. I am curious as to why a developer would want to hide an error rather than fixing it to keep the application up-to-date and prevent subsequent internal errors. That seems like a clunky idea.Bankable
The path of config.inc.php on Windows / Wamp is C:\wamp64\apps\phpmyadmin5.0.2\config.inc.phpHowlyn
B
14

I had the same error message on Debian 11 after switching from php7.4 to php8.1.

What solved the issue was upgrading phpMyAdmin to the latest version manually.

=======Steps to followed=====

Back up phpMyAdmin

You should back up your current phpMyAdmin folder by renaming it.

 $ sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

Create a new phpMyAdmin folder

$ sudo mkdir /usr/share/phpmyadmin/

Change to the directory

$ cd /usr/share/phpmyadmin/

Download and Extract phpMyAdmin

$ sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

Now extract

$ sudo tar xzf phpMyAdmin-*-all-languages.tar.gz
Once extracted, list folder

$ ls

You should see a new folder phpMyAdmin-*-all-languages

We want to move the contents of this folder to /usr/share/phpmyadmin

$ sudo mv phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin

Make a copy of /usr/share/phpmyadmin/config.sample.inc.php

$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

Now edit the config.inc.php

$ sudo nano config.inc.php

$cfg['blowfish_secret'] = 'Zbwen/BEAFv:HTbqOROrqakJ;KUMIpV:'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

$ Ctrl+x /* to save the file */

Go to your site/phpmyadmin check all error is cleared.

=================================================

YOU MAY ENCOUNTER THIS ERROR MESSAGE ON PHPMYADMIN /INDEX.PHP

IT MAY SAY SOMETHING LIKE:

The $cfg['TempDir'] (/usr/share/phpmyadmin/tmp) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

===SOLUTION==

$ sudo mkdir -p /var/tmp/phpMyAdmin

$ sudo chown www-data:www-data /var/tmp/phpMyAdmin

$ sudo chmod -R 700 /var/tmp/phpMyAdmin

Edit the config.inc.php again

$ sudo nano config.inc.php

add or replace this line

$cfg['TempDir'] = '/var/tmp/phpMyAdmin';

Cleanup -- You can now delete the tar.gz file and the empty folder.

$ sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz

And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.

$ sudo rm -rf /usr/share/phpmyadmin.bak
Bankable answered 15/12, 2022 at 19:46 Comment(5)
I updated my php version and made some changes in php.ini file which resolved the problemKerrin
That is good to know, but what changes do you make?Bankable
I had the Deprication Notices on Ubuntu Server 20 after switching from php7.4 to php8.2. What solved the issue was upgrading phpMyAdmin to the latest version manually as described above. Thank you.Fennel
Thanks @ShapCyber! Thanks for putting in so much work to make a clean instructional. I followed every step and everything works great now!Pursuance
Works fine in Ubuntu. Had same issue after upgrading php from 7.4 to 8.3.Sweetsop
A
2

From now you can turn off errors following these two steps:

  1. Open /usr/share/phpmyadmin/themes/pmahomme/layout.inc.php
  2. Add after <?php error_reporting(0);

Please note that this is not official information!

Antipyrine answered 3/6, 2022 at 20:4 Comment(1)
This files does not exists on phpmyadmin installed from packages on Debian 11.Daube
M
2

I had the same issue after upgrading my PHP Version to 8.1 using MAMP's phpmyadmin 5. I could only find out a way to get rid of it thanks to this here:

  • Go to your phpmyadmin, even if it repeatedly logs deprecation warnings into your page
  • Select the Preferences Tab in your phpmyadmin interface (you have to be in your main phpmyadmin page for this tab to show up, and not have any table / db selected)
  • Select Functions and scroll down to Error Reports and select Never send and click on OK to save it. done!

I though that this should technically correspond to this:

$cfg['SendErrorReports'] = 'never';

But as it seems, there are additional steps involved. Anyway, working now!

Mayan answered 31/8, 2022 at 13:45 Comment(1)
Here I faced the issue because some of my databases' version is mismatched with current MySQL version in that case this solution might not be idle.Kerrin
E
2

I just used the standard update function from MAMP PRO itself. Menu MAMP PRO > Check for Updates… There i Run Install on the update phpMyAdmin5 5.1.0 -> 5.2.0. That worked for me.

Epochmaking answered 2/11, 2022 at 8:41 Comment(3)
wamp does not have any option for updating versionKerrin
Thanks for this, didn't even realise there had been an update!Neoprene
solved my problem, first i updated my mamp pro , then an update appeared for phpmyadminAureomycin
D
1
  1. Open your xampp control panel.

  2. Go to apache > config > phpMyAdmin(config.inc.php) file.

  3. Just add this line in below of all code in this file...

      $cfg['SendErrorReports'] = 'never';
    
Daughterinlaw answered 22/4 at 21:32 Comment(0)
K
0

if you use a wamp server then you can put down the downloaded files from [https://www.phpmyadmin.net/downloads/] of PHPMyAdmin new version on apps folder. then go to alias folder and you have to change in phpmyadmin.conf

Alias /phpmyadmin "d:/wamp64/apps/phpmyadmin5.2.0/" //change it here

<Directory "d:/wamp64/apps/phpmyadmin5.2.0/"> //change it here

then Save and Restart wamp services

Korea answered 9/7, 2022 at 10:5 Comment(0)
T
0

open : your_ip_or_domain/phpmyadmin/prefs_forms.php?form=Features

Then put the value of the option (Send error reports) on the option (Never send error reports).

Touchwood answered 16/11, 2023 at 8:0 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewRedhanded
O
0

If there are some twig consoles in

ls -lha /usr/share/phpmyadmin/tmp/twig

Delete all in one time

rm -R /usr/share/phpmyadmin/tmp/twig
Occupant answered 16/7 at 18:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.