How to deploy PHP with libcURL?

How to deploy PHP with libcURL?

One of the best URL transfer libraries is known as LibcURL. It is completely designed in a user-friendly aspect and free to use. With the use of URL syntax, it is easy to get files. PHP software like Billing software uses the library called cURL where LibcURL takes the responsibility to get connected with payment modes and banks. Here, we are going to discuss the upgrade or installation of the new version in LibcURL by integrating the PHP server.

Installation of LibcURL:

LibcURL is available in free installation mode and it is seen below GPL.

Download and cURL compile:

Code:
wget http://curl.haxx.se/download/curl-7.15.3.tar.gz
( To get the latest version goto http://curl.haxx.se/download.html )
tar -xzf curl-7.15.3.tar.gz
cd curl-7.15.3
/configure
make
make install
Using the support of SSL, you can compile cURL easily. Once if you do openssl installation just open it with a custom directory and don’t forget to provide “-with-ssl=” for perfect compilation.

By now, it’s been installed to /usr/local/ directory

curl cert bundle CA installation:

We will often be looking for only secure accessed sites like HTTPS right! In that case, if the HTTPS work with a combination of cURL it needs a big list of authorized websites that should be attempt curl too.

To get ca-bundle latest one kindly use the below-mentioned command:

Code:
http://curl.haxx.se/ca/cacert.pem
In default configuration settings, cURL needs for ca bundle so try out below-mentioned command:

Code:
/usr/local/share/curl/curl-ca-bundle.crt
Do installation of RMP in curl with below mentioned command:

Code:
/usr/share/ssl/certs/ca-bundle.crt
To check till now whether you are going the exact path do execute on the below-mentioned command here:

Code:
$curl-config–ca
Now, update ca-bundle to latest version by using the below-mentioned command:

Code:
$ wget http://curl.haxx.se/ca/cacert.pem
$ mv /usr/local/share/curl/curl-ca-bundle.crt /usr/local/share/curl/curl-ca-bundle.crt.old
$ mv cacert.pem /usr/local/share/curl/curl-ca-bundle.crt
Curl binary test:

Use the argument URL for testing curl binary. Now, you will be visible with the web pages where you can see the statistics list of curl binary.

For your reference, we are giving the output as:

Code:
$ curl http://www.yahoo.com > test.txt
% Total % Received % Xferd Average Dload Speed Upload Time Total Time Spent Time left Current Speed
100 32420 0 32420 0 0 14676 0 -:-:- 0:00:02 -:-:- 41571
PHP integration:

Just follow the below steps for integrating PHP:

Step 1: Start downloading the source code of PHP.

Code:
Untar and cd php-X.X.X
Step 2: Go to the configuration command and start adding the -with-curl=/usr/local”. Now, PHP takes apart to look after the directory for having include/curl/.

Step 3: Do installation and don’t forget to restart the apache.

Using the test script you can make sure the activity of PHP is working with cURL.
Author
kumkumsharma
Views
2,890
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top