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 generate a UUID in MySQL using PHP?
- How to create an SSL connection to MySQL using PHP?
- How to insert a null value in MySQL using PHP?
- How to update to null value in MySQL using PHP?
- How to export data from MySQL to Excel using PHP?
- How to check the result of an insert in PHP and MySQL?
- How to fetch an associative array from MySQL in PHP?
- How to create a connection pool in a MySQL database using PHP?
- How to store a boolean value in a MySQL database using PHP?
- How to output XML from MySQL using PHP?
See more codes...