php-mysqlHow to install the PHP MySQL extension on Ubuntu?
- Install the
php-mysqlpackage using apt:
sudo apt-get install php-mysql
- Enable the extension in the
php.iniconfiguration file:
extension=mysql.so
- Restart the web server to apply the changes:
sudo service apache2 restart
- Verify the installation by creating a
phpinfo.phpfile:
<?php
phpinfo();
?>
- Access the file in a web browser and check for the
mysqlsection in the output:
mysql
MySQL Support => enabled
Client API version => 5.7.25
Helpful links
More of Php Mysql
- How to use a MySQL union in PHP?
- How to order by a column in MySQL using PHP?
- How to use a variable in a MySQL query using PHP?
- What port to connect to MySQL from PHP?
- How to insert a null value in MySQL using PHP?
- How to change database in MySQL with PHP?
- How to prepare a statement in MySQL using PHP?
- How to list databases in PHP and MySQL?
- How to insert a date into a MySQL database using PHP?
- How to check if a record exists in PHP and MySQL?
See more codes...