9951 explained code solutions for 126 technologies


php-mysqlHow to install MySQL extension for PHP?


  1. To install MySQL extension for PHP, you need to have the MySQL server installed and running.
  2. Then, you need to install the PHP MySQL extension. This can be done by running the following command in the terminal:
$ sudo apt-get install php-mysql
  1. After the installation is complete, you need to restart the web server for the changes to take effect.
  2. You can then verify that the MySQL extension is installed by running the following command in the terminal:
$ php -m | grep mysql
  1. The output should be something like this:
mysql
mysqli
pdo_mysql

Helpful links

Edit this code on GitHub