-4

I am following this guide, How to set up a web server on the Raspberry Pi. I am using a Pi 400 so I skipped step 1.

Step 2 involved running;

sudo apt install nginx

which was successful. Now if I re-run the command I get;

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nginx is already the newest version (1.18.0-6.1+deb11u3).
The following packages were automatically installed and are no longer required:
  libbasicusageenvironment1 libfuse2 libgroupsock8 liblivemedia77
  libusageenvironment3
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 275 not upgraded.

In step 3 I encountered a problem;

First I ran

sudo apt-get install mysql-server

returned

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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:
  mariadb-server-10.0

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

I used:

sudo apt install default-mysql-server

and it downloaded.

Now on step 4,

Install PHP

tells me to use:

sudo apt-get install php5-fpm php5-mysql

but I get the same "Package is not available" message like last time.

What is the solution?

4
  • 1
    Mysql isn't available anymore. Install MariaDB instad
    – LilData777
    Commented Jan 27, 2023 at 18:49
  • When it says package is not available, that means what it says it means. It is common for that to happen. What I do, I search up the error with the package name then find an alternative.
    – LilData777
    Commented Jan 27, 2023 at 19:16
  • 1
    Does this answer your question? Trouble installing MySQL Commented Jan 27, 2023 at 20:17
  • Don't use 5 year old tutorials from random websites. Try official documentation.
    – Milliways
    Commented Jan 27, 2023 at 21:37

1 Answer 1

0

The main problem is that you are trying to follow an old tutorial. PHP 5 was released around 2016 or 2017. The latest version of PHP is 8.

The command to install PHP is

sudo apt-get install php -y

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.