Compiling php with curl, where is curl installed?

后端 未结 5 1016
忘掉有多难
忘掉有多难 2020-12-24 00:42

I need to specify a directory when compiling php with --with-curl=

The curl binary is located at /usr/bin/curl

curl -V

相关标签:
5条回答
  • 2020-12-24 01:28

    Try just --with-curl, without specifying a location, and see if it'll find it by itself.

    0 讨论(0)
  • 2020-12-24 01:29

    If you're going to compile a 64bit version(x86_64) of php use: /usr/lib64/

    For architectures (i386 ... i686) use /usr/lib/

    I recommend compiling php to the same architecture as apache. As you're using a 64bit linux i asume your apache is also compiled for x86_64.

    0 讨论(0)
  • 2020-12-24 01:31

    For Ubuntu 17.0 +

    Adding to @netcoder answer above, If you are using Ubuntu 17+, installing libcurl header files is half of the solution. The installation path in ubuntu 17.0+ is different than the installation path in older Ubuntu version. After installing libcurl, you will still get the "cURL not found" error. You need to perform one extra step (as suggested by @minhajul in the OP comment section).

    Add a symlink in /usr/include of the cURL installation folder (cURL installation path in Ubuntu 17.0.4 is /usr/include/x86_64-linux-gnu/curl).

    My server was running Ubuntu 17.0.4, the commands to enable cURL support were

    sudo apt-get install libcurl4-gnutls-dev
    

    Then create a link to cURL installation

    cd /usr/include
    sudo ln -s x86_64-linux-gnu/curl
    
    0 讨论(0)
  • 2020-12-24 01:34

    php curl lib is just a wrapper of cUrl, so, first of all, you should install cUrl. Download the cUrl source to your linux server. Then, use the follow commands to install:

    tar zxvf cUrl_src_taz
    cd cUrl_src_taz
    ./configure --prefix=/curl/install/home
    make
    make test    (optional)
    make install
    ln -s  /curl/install/home/bin/curl-config /usr/bin/curl-config
    

    Then, copy the head files in the "/curl/install/home/include/" to "/usr/local/include". After all above steps done, the php curl extension configuration could find the original curl, and you can use the standard php extension method to install php curl.
    Hope it helps you, :)

    0 讨论(0)
  • 2020-12-24 01:40

    None of these will allow you to compile PHP with cURL enabled.

    In order to compile with cURL, you need libcurl header files (.h files). They are usually found in /usr/include/curl. They generally are bundled in a separate development package.

    Per example, to install libcurl in Ubuntu:

    sudo apt-get install libcurl4-gnutls-dev
    

    Or CentOS:

    sudo yum install curl-devel
    

    Then you can just do:

    ./configure --with-curl # other options...
    

    If you compile cURL manually, you can specify the path to the files without the lib or include suffix. (e.g.: /usr/local if cURL headers are in /usr/local/include/curl).

    0 讨论(0)
提交回复
热议问题