Как обновить phpmyadmin debian

Обновлено: 08.07.2024

PHP 8.0 содержит много новых функций и улучшений производительности, синтаксиса, безопасности и стабильности. Установка PHP 8.0 практически на любой сервер упрощается благодаря предварительно скомпилированным пакетам, доступным во всех поддерживаемых в настоящее время версиях Debian и Ubuntu.

Изменения расширений и зависимостей в PHP 8.0

Несмотря на огромное количество изменений в PHP 8.0, в принципе было произведено не так много изменений в его зависимостях и структуре расширений.

Расширение JSON теперь всегда доступно , и нет флага компиляции для его исключения. Это означает, что больше нет необходимости явно устанавливать пакет php-json.

Расширение xmlrpc перемещено в PECL по уважительным причинам. Репозитории программного обеспечения, упомянутые в этом посте, не включают xmlrpc расширения для PHP 8.0.

Кроме того, в Windows название расширения GD было изменено с php_gd2.dll на php_gd.dll.

Изменения в файле INI PHP 8.0

Также есть несколько изменений в файле INI.

  • По умолчанию утверждения вызывают исключения - ( assert.exception=1)
  • Отображение ошибок по умолчанию установлено на E_ALL - ( error_reporting=-1)
  • При запуске теперь по умолчанию ошибки включены - ( display_startup_errors=1)
  • Новая функция JIT в PHP 8.0 добавляет несколько новых директив INI.
  • Параметр zend.exception_string_param_max_len для настраиваемой длины строки трассировки стека исключений

Установка PHP 8

1. Необходимо добавить репозиторий ondrej/phpPPA

Приведенные выше шаги добавят PPA в качестве источника пакетов, который содержит все пакеты PHP и их зависимости, такие как argon2 и libzip.

2. Установите PHP 8.0 и нужные расширения

Все пакеты PHP 8.0 следуют шаблону php8.0-имя_расширения , и пакет php8.0-common включает необходимый набор расширений по умолчанию.

Установите PHP 8.0 CLI для работы в консоли

Вы можете установить дополнительные расширения по тому же шаблону php8.0-имя_расширения. Обратите внимание, что вам не нужно устанавливать, так php8.0-json, так как теперь он включен по умолчанию.

Пример установки еще нескольких полезных расширений:

Для разработки также могут быть установлены инструменты покрытия кода или отладчик Xdebug.

Установка PHP8 fpm

В зависимости от используемого веб-сервера вам необходимо будет установить дополнительные пакеты для интеграции с веб-сервером.

Для использования Apache mpm_event, Nginx, Litespeed и т. д. нужно будет установить php8.0-fpm

Для использования Apache mod_php установите libapache2-mod-php8.0

Чтобы проверить установку PHP и расширений, выполните следующие команды:

Если вам потребуется удалить старые пакеты PHP, можно воспользоваться командой

Это предполагает, что вы используете PHP 7.4 в качестве предыдущей версии. Но будьте осторожны, сначала сто раз проверьте что вы больше не используете старые версии в своих проектах.

Смена установленной версий PHP по умолчанию.

Если вдруг вас не устраивает новая установленная версия PHP, вы можете сменить другую версию по умолчанию, командой:

И введя номер нужной вам предыдущей версии PHP.


Веб-разработчик со стажем программирования более 9 лет, всегда в процессе учебы и созидания.

Некоторое время назад я установил phpMyAdmin на свой сервер Debian 7 через apt-get install phpmyadmin , и была установлена ​​версия "3.4.11.1deb2". Текущая последняя версия - 4.1.12 (я искал ее на сайте phpMyAdmin).

Моя проблема в том, что когда я запускаю команду apt-get update и apt-get upgrade , она обычно должна обновлять все установленные пакеты, но не обновляет phpMyAdmin до последней версии. Должен ли я делать это вручную, и если да, то как это сделать?

2 ответа

Нет, ведет себя так, как ожидалось.

Любой выпуск Debian поставляется с версиями программного обеспечения, которые считались «стабильными» на момент выпуска Debian. На самом деле «немного» раньше, поскольку Debian делает все возможное, чтобы убедиться, что программное обеспечение в выпуске действительно стабильно и хорошо работает вместе со всеми другими пакетами в этом выпуске (а пакетов тоже довольно много: iirc , Debian 7 поставляется с почти 50000 различными программными пакетами!).

Debian 7 (кодовое имя «wheezy») был выпущен 4 мая 2013 года. В то время, вероятно, нигде не было доступного phpmyadmin-4.x (даже на жестких дисках разработчиков phpmyadmin). Вот почему Debian 7 поставляется с phpmyadmin-3.4.11.1 .

Иногда пакеты обновляются после выпуска Debian. Это только для устранения серьезных проблем с безопасностью и никогда только для получения новой «горячей и свежей» версии данного пакета. Каждый раз, когда вы выполняете aptitude update && aptitude upgrade , вы обновляете пакеты только в выбранном вами выпуске Debian (автоматическое обновление до нового выпуска может потребовать загрузки тысяч пакетов и удивить вас совершенно новой системой, когда вы в следующий раз посмотрите на нее).

Существует онлайн-интерфейс, где вы можете проверить, какая версия данного пакета находится в какой (в настоящее время поддерживается) Выпуск Debian.

Итак, чтобы получить последнюю версию данного пакета, у вас есть следующие возможности:

проверьте, есть ли у кого-нибудь резервное копирование последней версии вашего любимого пакета в выпуск Debian, который вы используете.

обновите свой Debian до версии, которая его поддерживает

скачать / собрать пакет самостоятельно (желательно создать правильный пакет Debian, которым вы можете поделиться с другими людьми)

Вы можете использовать репозиторий Jessie для обновления определенных пакетов Wheezy, но все обычные предупреждения применимы. Проверить это на резервной машине - действительно хорошая идея,

Скопируйте /etc/apt/sources.list> /etc/apt/sources.list.wheezy

Отредактируйте файл /etc/apt/sources.list:

И замените содержимое /etc/apt/sources.list следующими строками:

(Измените h.t.t.p> http. Вы можете заменить "de", например, "us" или кодом вашей страны, но это не должно иметь никакого значения).

Сохраните файл и выполните следующую команду, чтобы обновить базу данных источников:

НЕ ЗАПУСКАЙТЕ apt-get upgrade!

Выберите свои варианты. Я не менял свою конфигурацию, но обновил базу данных.

Затем, на всякий случай, я побежал

ВАЖНО . Смените репозиторий обратно на wheezy!

Whether your repository is too slow to deliver the latest version of phpMyAdmin or you are having compatibility issues with your current version, in this article we will manually download and install the latest version of phpMyAdmin.

Introduction

Guide updated and tested in June 2021.

This guide has been tested from Ubuntu 20.10 to 16.04. It should also work for other Debian-based distributions without issue. For CentOS users, please refer to the comments section at the end of this page as commands will be different. I will try to update this guide for CentOS as soon as I get the chance to test it. In the meantime, if you have any suggestions on how to improve this guide, please let me know in the comments.

1. Back up phpMyAdmin

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

Create a new phpMyAdmin folder

Change to directory

2. Download and Extract phpMyAdmin

Update Feb 2020: phpMyAdmin 5 has been released but it is only compatible with PHP 7.1 and above. To find out your PHP version in command line, run php -v .

phpMyAdmin version 4.x is now in the LTS phase, where only security fixes and critical bug fixes are made. Users are advised to migrate to version 5 (read more).

Visit the phpMyAdmin download page and look for the .tar.gz URL and download it using wget . In this guide we are using version 5.1.1, released June 2021. If a later version is now available, make sure to change the commands below to match (and let me know in the comments so I can update the guide 😉). If you are having issues with phpMyAdmin 5.x, try phpMyAdmin-4.9.7 instead.

Once extracted, list folder

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

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

You can now log back into phpMyAdmin and check the current version. You may also see two errors:

phpMyadmin blowfish secret error and tempdir not writable error

3. Edit vendor_config.php

3.1. $cfg[‘TempDir’] (./tmp/) is not accessible

If you are seeing an error The $cfg[‘TempDir’] (./tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

Press CTRL + W and search for TEMP_DIR

If you see something like below, delete it.

Save file and exit. (Press CTRL + X , press Y and then press ENTER )

3.2. blowfish_secret

You may also see an error The configuration file now needs a secret passphrase (blowfish_secret). The blowfish secret is used by phpMyAdmin for cookie authentication.

Press CTRL + W and search for CONFIG_DIR

phpMyAdmin will now generate its own blowfish secret based on the install directory.

Save file and exit. (Press CTRL + X , press Y and then press ENTER )

3.3. Log back in

Now log back in to phpMyAdmin and ensure the errors are gone.

If you are seeing an error “The secret passphrase in configuration (blowfish_secret) is too short.”, see below.

If you are having issues with phpMyAdmin 5, try phpMyAdmin-4.9.7 instead as this is the latest stable release for PHP 7.0 and lower and MySQL 5.4 and lower.

4. Cleanup

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

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

Blowfish Secret Error “Too Short”

If you are seeing an error “The secret passphrase in configuration (blowfish_secret) is too short.”

Copy it and paste it into blowfish_secret.inc.php.

Save and exit (press CTRL + X , press Y and then press ENTER )

Let me know if this helped. Follow me on Twitter, Facebook and YouTube, or 🍊 buy me a smoothie.

p.s. I increased my AdSense revenue by 200% using AI 🤖. Read my Ezoic review to find out how.

473 replies

Leave a reply

thank you so much!

This is a really good tutorial. Thanks a lot

Many thanks! Updated and works and I’m veryyy happy.

What I get is a 404 error. I can see all the files are there so it looks like a permissions issue, had to run CHMOD, CHOWN and create a tmp folder. Works now.

What I get is a 404 error. I can see all the files are there so it looks like a permissions issue

Saved my life, thank you!

Excellent tutorial! Worked perfectly! Thank you!

Great guide! Thanks so much!

Thank you very much! Excellent tutorial!

5.1.1 is now available
and thank you!

Thank you very much for your tutorial that helped me a lot. Upgrade from Ubuntu 18 to 20 make a mess, but is sorted

Thank you:
I’ve just followed the instructions and used the latest version 5.1.1 and all is now fixed
I did have to make the changes in the vendor_config.php to remove the warnings.
PRETTY_NAME=”Raspbian GNU/Linux 10 (buster)”
NAME=”Raspbian GNU/Linux”
VERSION_ID=”10″
VERSION=”10 (buster)”
VERSION_CODENAME=buster

Work ! thank you

sudo mv /usr/share/phpMyAdmin/ /usr/share/phpMyAdmin.bak

sudo mkdir /usr/share/phpMyAdmin/

sudo tar xzf phpMyAdmin-5.1.1-all-languages.tar.gz

sudo mv phpMyAdmin-5.1.1-all-languages/* /usr/share/phpMyAdmin

sudo mkdir /var/lib/phpMyAdmin/tmp/
sudo chown -R apache:apache /var/lib/phpMyAdmin/tmp
sudo chmod -R 0755 /var/lib/phpMyAdmin/tmp/

sudo nano /usr/share/phpMyAdmin/libraries/vendor_config.php

Awesome – Thank You
It’s Still working on Ubuntu 16.04.7 LTS
I installed phpMyAdmin 4.9.7

Excellent article, Thank you.
If anyone found some error after doing every step in this article, you may found a message like “The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why. Or alternately go to ‘Operations’ tab of any database to set it up there.”
Don’t panic, first, you should log in as root and scroll down to found the message that I mentioned and then click find out why and click create a database for configuration like something like that, and waiting for creating some table, it shows OK, finally, you can use phpMyAdmin normally. 🙂

Thanks. All worked.

This worked out like good for PHP 8.0.5 May – 2021
Thanks.

Awesome, this worked for me. Thank you!

Excelent tutorial thanks!

bro, you are really save my time.. running flawlesly, thanks a lot.. I was implement it on my dev and production server..

Excellent instruction – works perfect on a Pi!

Awesome instructions, thanks.
I particulary like the way you give us both the exact syntax and a clear explanation about what we’re doing.

EXCELLENT, yes all in caps. It worked perfectly. Thank you so much

Thanks so much! Worked flawlessly.

Afte I make all the steps , I got connection refused to all my users

Thank you a lot :+1:

Thank you so so much, you are a life saver and I wish you all the best 🙂

I never comment on stuff I read, but damn! Thanks dude.

Thank you, works every time!

OMG! Thank you so much for this, i can finally use phpmyadmin!

this works amazingly every time. thank you very much!

You should also consider to delete the default setup UI, it is a security risk.
Just delete the directory: /usr/share/phpmyadmin/setup/

There is a new version of phpmyadmin (5.1.0) released on 2021-02-24 🙂

Thanks a lot, it worked perfectly for me!

Thank you very much for that tutorial!

This is the first How-To I have followed to the letter that worked the first time in a long time! Thank you for the effort.

Fantastic. Did the job perfectly.

Thanks very much – worked a treat on Raspberry Pi OS (Buster).

upgrade process worked great, been fighting this for a while, and you saved me! well done!

Muchas gracias por el turorial!!

aqui o phpmyadmin nem carrega mais

just perfect
And really well detailed! Great Job

Worked and works like a charm.

JUST AWESOME OMG THANKS. ahah, sorry.

That is a great tutorial. But in my case when trying to open phpMyAdmin, it gave me a Permission denier error. So I had to run chmod 777 /var/lib/php/session/ then it worked.

Very good. Thank you very much!

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

Very nice guide! Thanks a lot!
Kudos and greetings from Germany!

This is the best tutorial ever I’ve followed online.

Thanks for the clear explaination..

Some Kudo’s for you!

Thanks a lot. This is great and life-saving for me.

Great walkthrough, thanks!

This is just brilliant!
Thank you soo much.

Awesome! Case does matter though in centos it’s /usr/share/phpMyAdmin/

Worked all great! Thanks.

Thanks. Worked perfectly once I found MY typo!

Followed all steps and now phpmydamin just opens to a blank page. Rebooting made no difference.

Resolved – it was a typo

Thank you so much!

I had some trouble, but after copying the old “config.inc.php” over, everything runs perfect.

Great Tutorial ! I don’t know what exactly happened but after closely following the instructions to install phpmyadmin I get the infamous 4O4 ERROR – URL not found on this server. Every other thing worked as per the instructions.

Thanks for the awesome tutorial

New Version of phpMyAdmin 🙂
Thanks for this complete tutorial ^^

There is again a new version (5.0.4) ^^

Great article. Very professionnal. Thanks.

Hello, I have a question, I really don’t know if you can help me, but if you do, I would appreciate it too much! The problem is the following: I have a VPS, in it I put the Phpmyadmin, mysql, etc …, I also installed the OGP (Open Game Panel), the fact is that when I create the database of one of my server games, everything is fine, it connects well and everything, but when I enter the game and try to register, it does not let me, I get that the account “supposedly already exists”, but in reality it does not exist, a table must be created in the table ” users ” with the user’s data, but it is not like that, I get that error, if you could help me I would appreciate it, I know it does not have much to do with what you published, but I am new to this and I do not know how to fix it .

Postscript: It is not the game, since the game is called “SAMP” (San Andreas MultiPlayer) and actually in other VPS if it works well, but not in mine, then the problem must be with MySQL or PhpMyAdmin, but I really don’t know.

Со времени выпуска Ubuntu 18.04 и других дистрибутивов Linux у многих людей возникли проблемы с совместимостью PHP 7.2 и phpMyAdmin 4.6. В посте мы разберем как решить эту проблему и что делать дальше

Когда у вас стоит phpMyAdmin и в репозитории не обновляют последнюю версию, а warning'ы типа

уже начинают доставать, то тут либо заходить в каждый файл и заменять строчки кода;

либо же, что логичнее всего, обновить версию phpMyAdmin до последней версии, вручную.

Обновление phpMyAdmin до последней версии

1. Сделайте резервную копию

На всякий пожарный случай, можно сделать резервную копию текущей папки phpMyAdmin, переместив ее с добавлением к имени, что-нибудь типа bak:

2. Загрузите и распакуйте phpMyAdmin

Зайдите в папку phpMyAdmin, скорее всего это будет:

Далее, зайдите на страницу загрузок phpMyadmin, скопируйте ссылку на последнюю версию, и загрузите zip архив с помощью wget:

На сегодняшний день, последняя стабильная версия 4.9.2. Если теперь доступна более поздняя версия, не забудьте изменить версию в ссылке.

Далее распакуем архив с помощью unzip, если нет данной утилиты, то установите ее sudo apt-get install unzip:

3. Скопируйте и удалите папку и архив

Для надежности используем команду cp (копировать), чтобы скопировать распакованную папку! Обратите внимание, что необходим -r аргумент, так как это папка:

Если все прошло успешно можно удалить ненужные папку и архивы:

Теперь же зайдя по адресу /phpmyadmin мы уже можем увидеть обновленную версию PMA, но внизу будут предупреждения об отсутствии временной папки tmp и пустой парольной фразе blowfish_secret:


4. Отредактируйте конфигурационные файлы

Первый вариант - это замена в файле "/usr/share/phpmyadmin/libraries/vendor_config.php" параметры TEMP_DIR и CONFIG_DIR на значения ниже:

phpMyAdmin теперь будет генерировать собственный blowfish_secret на основе каталога установки.

Второй вариант - создать временную папку в корне /usr/share/phpmyadmin, как ссылается параметр конфига TEMP_DIR и назначить ей владельца пользователя www-data:

Предупреждение о папке tmp должно исчезнуть в phpMyAdmin.

Далее нужно скопировать сэмпл конфигурационного файла config.sample.inc.php в config.inc.php, найти параметр blowfish_secret и вставить вместо пустой строки свой хэш:

Сгенерируйте произвольный хеш и вставьте в параметр конфига blowfish_secret:

сохраните файл. Предупреждение об blowfish_secret так же должно исчезнуть.

Второй вариант прост в использовании, но лучше все же изменять vendor_config, что даст некоторые преимущества в работе с phpMyadmin в будущем.

Скрипт PMA Updater


Веб-разработчик со стажем программирования более 9 лет, всегда в процессе учебы и созидания.

Читайте также: