Detailed explanation of how to install PHP curl extension under Linux

Detailed explanation of how to install PHP curl extension under Linux

This article describes how to install the PHP curl extension under Linux. Share with you for your reference, the details are as follows:

I encountered such a problem during development today, which is how to install the curl extension of PHP under Linux. My LNMP environment was originally compiled and installed, not installed using YUM.

My environment:

Linux: CentOs 6.4
PHP: 5.6.30

Solution:

1. Enter the PHP source directory, which is the address where PHP was downloaded to the server and decompressed before.

cd /usr/local/src/php-5.6.30

2. Run ext/curl in the PHP source directory

cd ext/curl

3. Call the phpize program to generate a compiled configuration file

/usr/local/php/bin/phpize 

4. Call configure to generate Makefile

./configure --with-curl=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config

5. Compile and install

make & make install

At this point, the path to generate the file curl.so will be prompted:

/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

6. Modify the php.ini file

vim /usr/local/php/lib/php.ini
extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/curl.so

7. Detection

/usr/local/php/bin/php -m

If you see the curl item, it means the installation is successful

8. Restart php-fpm

pkill -9 php-fpm
./sbin/php-fpm

OK!

I hope this article will help you configure your Linux server.

You may also be interested in:
  • Detailed tutorial on installing php-fpm service/extension/configuration in docker
  • Detailed explanation of installation and configuration of Redis and phpredis extension operation in Ubuntu 18.04 system
  • Detailed steps to install xml extension in php under linux
  • Solve the problem that PHP extension installation does not take effect
  • Detailed installation of PHP environment and extensions on Mac
  • Mac pecl installation php7.1 extension tutorial
  • How to install PHP7 Redis extension on CentOS7
  • How to install memcache extension in PHP
  • How to install BCMath extension in PHP
  • PHP extension installation method and steps analysis

<<:  Detailed explanation of the use of find_in_set() function in MySQL

>>:  VUE+Canvas realizes the whole process of a simple Gobang game

Recommend

MySQL concurrency control principle knowledge points

Mysql is a mainstream open source relational data...

Summary of JavaScript's setTimeout() usage

Table of contents 1. Introduction 2. The differen...

Introduction to CSS BEM Naming Standard (Recommended)

1 What is BEM Naming Standard Bem is the abbrevia...

JS realizes the automatic playback effect of pictures

This article shares the specific code of JS to ac...

Detailed steps to install MySQL 5.7 via YUM on CentOS7

1. Go to the location where you want to store the...

Implementation of socket options in Linux network programming

Socket option function Function: Methods used to ...

How does Vue solve the cross-domain problem of axios request front end

Table of contents Preface 1. Why do cross-domain ...

Essential Handbook for Web Design 216 Web Safe Colors

The color presentation on a web page will be affec...

VMware WorkStation 14 pro installation Ubuntu 17.04 tutorial

This article records the specific method of insta...

Introduction to HTML DOM_PowerNode Java Academy

What is DOM? With JavaScript, you can reconstruct...

SQL group by to remove duplicates and sort by other fields

need: Merge identical items of one field and sort...

MySQL data type details

Table of contents 1. Numeric Type 1.1 Classificat...

How to view files in Docker image

How to view files in a docker image 1. If it is a...

What is HTML?

History of HTML development: HTML means Hypertext...

Installation process of MySQL5.7.22 on Mac

1. Use the installation package to install MySQL ...