The steps for php to install the mysql extension are: 1. Download the mysql extension and unzip it; 2. Initialize using the phpize tool; 3. Configure; 4. Compile and install; 5. Edit the php.ini configuration file and add [ extension=pdo_mysql.so]; 6. Restart the service.
The specific steps are as follows:
(Video tutorial recommendation: php video tutorial)
1 , download the mysql extension
2. Unzip it and use the phpize tool to initialize it (phpize is usually under the PHP installation directory /bin/) and execute it in the folder after the extension is decompressed
/www/server/php/71/bin/phpize
3. configure
./configure --with-php-config=/www/server/php/71/bin/php-config
4. Compile and install
make && make install
After this step, the system will prompt:
Installing shared extensions: /www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/
The mysql.so we want is in this path.
This path is also the default extension_dir:
PHP default extension_dir path
5. Modify php.ini
Add a line in the php.ini file:
extension=pdo_mysql.so
Save and restart the service.
Tip: If you modify extension_dir, you need to copy the mysql.so file to the corresponding path.
Related recommendations: php training
The above is the detailed content of What are the steps to install mysql extension in php. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
