I tried to created a LAMP web-server with Wordpress following that guide: https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress/6/. But when I used this command to install MySQL:

sudo apt-get install mysql-server php-mysql -y

I've got this error:

Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:

E: Package 'mysql-server' has no installation candidate

So, I installed MariaDB and created Wordpress database. I used these commands:

sudo apt install mariadb-server
sudo service apache2 restart
cd /var/www/html/
sudo wget http://wordpress.org/latest.tar.gz 
sudo tar xzf latest.tar.gz
sudo mv wordpress/* .
sudo chown -R www-data: .
sudo mysql_secure_installation
sudo mysql -uroot -p
create database wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'my_password';

But Wordpress configuration page gave me an error:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Should I install MySQL instead MariaDB? Or there's another problem?


1 Answer 1


I followed that guide: https://raspberrytips.com/wordpress-on-raspberry-pi/. It helped me to properly configure MariaDB and the error disappeared.

  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    May 6, 2020 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.