Home  >  Article  >  Backend Development  >  How to install pgsql extension in php

How to install pgsql extension in php

王林
王林Original
2021-09-06 16:27:074077browse

How to install pgsql extension in php: 1. Enter the ext directory and switch to pgsql; 2. Find phpize and execute the [./configure] command; 3. Execute the [make install] command.

How to install pgsql extension in php

The operating environment of this article: windows10, php 7, thinkpad t480 computer.

The specific steps to install the pgsql extension are as follows:

Find the pgsql library in the ext directory that comes with the php source code package, switch the directory to pgsql, and find phpize (bin in the php installation directory folder) execute the following command:

# /usr/bin/phpize
# ./configure --with-php-config=/usr/bin/php-config 找到php-config位置
# make && make install

If everything is normal, you will find that there will be two more pdo_pgsql in /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/ .so and pgsql.so.

Apache: In the php configuration file, remove the ";" related to pgsql, | Restart Apache | phpinfo(); At this time, the extension is found;

Nginx: In the php configuration file, Add extensions="pgsql.so", | Restart Nginx | ​​phpinfo(); At this time, the extension is found;

Recommended learning: php training

The above is the detailed content of How to install pgsql 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

Related articles

See more