From the description of the package php5-mysql
(version 5.3.10-1ubuntu3.2) :
This package provides modules for MySQL database connections directly from
PHP scripts. It includes the generic "mysql" module which can be used
to connect to all versions of MySQL, an improved "mysqli" module for
MySQL version 4.1 or later, and the pdo_mysql module for use with
the PHP Data Object extension.
So, the package php5-mysql
does contain support for MYSQLi extension.
TL;DR: If you want to stay with php5, you will need to stay at Ubuntu 14.04 LTS
Using PHP 7.0 on Ubuntu 16.04 LTS
Ubuntu 16.04 has switched to PHP 7.0 with a new infrastructure for PHP package. So, no, you can't install php5 on Ubuntu 16.04, but you can install PHP 7.0 packages with:
apt-get install libapache2-mod-php
That will install a virtual package that depends on the latest PHP version and pull libapache2-mod-php7.0
as a dependency.
If you are looking for extensions, always use a version-less variant as well (e.g. php-apcu
instead of php7.0-apcu
) as the PECL extensions are packaged without the version to allow smooth upgrades.
Using PHP PPA to coinstall PHP 5.6 with PHP 7.0
There's an option to co-install PHP 5.6 packages using ppa:ondrej/php
.
For more information, please see that answer: https://askubuntu.com/a/762161/309221
Extracted from link above:
Assuming libapache2-mod-php
is a suitable way to enable PHP in Apache for you, you can proceed in this way:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
Switch PHP version ( Apache ):
Best Answer
The file is there, only it is another version. It is also present on the release index
This is probably old apt indexes, you need to download them again, open a terminal and type
Make sure that your package list is updated before trying to install software.