I’m using the code sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
And I am getting back this
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package php5-mysql 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
E: Unable to locate package libapache2-mod-auth-mysql
E: Package 'php5-mysql' has no installation candidate```
I'm not sure what to do, I don't have much knowledge about literally anything I'm doing, I'm trying to learn how to set up an image hosting website but I have absolutely no knowledge about any of this, thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Since you’re on Ubuntu 16.x, you would need to use PHP 7 packages, which can be found by using:
sudo apt-cache search php7 --names-only
The package name for PHP’s MySQL extension is php7.0-mysql
. If you still want PHP 5.x packages you would need to install a repository which offers them or use an older LTS release of Ubuntu (though keep in mind, 16.04 is the latest LTS, thus support for older releases is coming to an end).
The repository in question can be added by running:
sudo add-apt-repository ppa:ondrej/php -y \
&& apt-get update
… then running:
sudo apt-cache search php5 --names-only
You could then install PHP 5.6.x packages.
What about the second error:
E: Unable to locate package libapache2-mod-auth-mysql
How did you fix that.Thanks for sharing!
What version of the OS are you using? Sounds like you are using a updated version like Ubuntu 16 where PHP is now version 7 and not version 5.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.