Home > Database > Mysql Tutorial > body text

How to install the mysql extension module in php

王林
Release: 2023-05-27 15:25:06
forward
2064 people have browsed it

1. Download the mysql extension from the php website

2. Unzip it, initialize it using the phpize tool, and compile the file package.

# tar xzvf mysql-45881bd.tar.gz
Copy after login

3. Enter the mysql extension directory

# cd mysql-45881bd/
Copy after login

4. Use phpize to initialize and place phpize in the /opt/ directory.

# /opt/php/bin/phpize
Copy after login

5. Edit the php.ini file directly, copy mysql.so to the current directory of php.ini, and then add extension=mysql.so in php.ini.

# cp /root/mysql-fae9884/modules/mysql.so /etc/
Copy after login

6. Restart php.

# /etc/init.d/php-fpm restart
Gracefully shutting down php-fpm . done
Starting php-fpm  done
Copy after login

When we use PHP, we usually configure some modules, and the functions that come with it are far from enough. Mysql is our commonly used database, and its extension module can be used in PHP.

The above is the detailed content of How to install the mysql extension module in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template