search
HomeBackend DevelopmentPHP ProblemWhat are the steps to install mysql extension in php

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.

What are the steps to install mysql extension in php

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:

What are the steps to install mysql extension in php

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Safe Exam Browser

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

Zend Studio 13.0.1

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft