Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile and install mysql for php

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "php how to compile and install mysql", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "php how to compile and install mysql" bar!

Php compilation and installation of mysql method: 1, enter the php source package installation path pdo_mysql directory; 2, run phpize;3, run config, specify mysql and php directory location; 4, compile and install, generate mysql.so;5, add mysql.so extension configuration.

This article operating environment: linux5.9.8 system, PHP7.1 version, DELL G3 computer

How does php compile and install mysql?

PHP compiles and installs extensions to mysql.so

1. Enter the pdo_mysql directory in the installation path of the php source package

/ usr/local/src/php/package/php-5.6.29/ext/pdo_mysql

2. Run phpize and generate a configure file in this directory

/ usr/local/php/bin/phpize

3. Run config and specify the location of the mysql and php directories

. / configure-prefix=/data/php-with-pdo-mysql=/data/mysql/bin/mysql_config-with-php-config=/data/php/bin/php-config-with-zlib-dir=/root/php-5.6.25/ext/zlib

4. Compile and install to generate mysql.so

Make & & make install

5. Modify php.ini file, add mysql.so extension configuration, and save and exit.

Vim / data/php/etc/php.iniextension=pdo_mysql.so

6. Restart php-fpm

Service php-fpm restart

7. Test, add a php file, such as / data/nginx/html/mysql.php, in the web directory

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report