CodeIgniter Forums

Full Version: PHP extensions needed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, in the CI 4 README.md file we can read :


Quote:## Server Requirements

PHP version 7.2 or higher is required, with the following extensions installed:

- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library

Additionally, make sure that the following extensions are enabled in your PHP:

- json (enabled by default - don't turn it off)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
- xml (enabled by default - don't turn it off)

I have intl, json, mbstring, mysqlnd, xml.
But not libcurl.
However I have curl ; does it enough or this 2 extensions are 2 differents things ? Thanks by advance.
(05-27-2019, 06:11 AM)Nombre Imaginaire Wrote: [ -> ]Hi, in the CI 4 README.md file we can read :


Quote:## Server Requirements

PHP version 7.2 or higher is required, with the following extensions installed:

- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library

Additionally, make sure that the following extensions are enabled in your PHP:

- json (enabled by default - don't turn it off)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
- xml (enabled by default - don't turn it off)

I have intl, json, mbstring, mysqlnd, xml.
But not libcurl.
However I have curl ; does it enough or this 2 extensions are 2 differents things ? Thanks by advance.
very clear. You need install libcurl if you plan using http/CurlRequest.
libcurl is a program that must be installed on the server. How it is installed depends on the operating system of the server.

cURL is PHP's api into libcurl and is compiled into PHP by default, AFAIK.
(05-27-2019, 06:55 AM)titounnes Wrote: [ -> ]very clear. You need install libcurl if you plan using http/CurlRequest.

Ain't really since it seems that the functionality have severals names and/or way to implement it depends of systems or time. As you see Dave speak about curlib. I browse the web and it's pretty hard to find clear (and updated) instructions. The only thing clear here that it says is kind of optionnal.
But if I don't make mistake if I want to allow user to download .pdf from my CI site I guess I'll need the cURL request to be activated, right ? (or some workaround exists ?)

(Does it is link somehow with the PHP-CLI version or I can neglect that part of the configuration ?)

FYI I work now on local with Wampserver and then I migrate it online on linux server.
(05-28-2019, 02:52 AM)Nombre Imaginaire Wrote: [ -> ]As you see Dave speak about curlib. I browse the web and it's pretty hard to find clear (and updated) instructions. The only thing clear here that it says is kind of optionnal.
But if I don't make mistake if I want to allow user to download .pdf from my CI site I guess I'll need the cURL request to be activated, right ? (or some workaround exists ?)

FYI I work now on local with Wampserver and then I migrate it online on linux server.

Oops! Major typo on my part! I wrote "curlib" when I should have used "libcurl". I have corrected my previous post.

In order to use PHP's cURL extension, you must have libcurl installed on the server.

To install libcurl on a Linux system you will use the package manager (PM). The PM will vary depending on the Linux distribution you have running. Let me know which Linux you're using and I might be able to provide installation instructions. What follows are instructions for one common Linux distribution.

Most Debian/Ubuntu distros use the PM apt. The most recent version on those distros is libcurl4, but libcurl3 will work too because it satisfies PHP's requirement for libcurl version 7.10.5 or later.

To see if libcurl is on your server use the server's CLI  to run this command
Code:
sudo apt list --installed | grep -i libcurl

Or you could attempt an install. If it's already there and up-to-date then nothing will change.

First, update the PM with the command
Code:
sudo apt update

Then install the libcurl library using the command
Code:
sudo apt install libcurl4

All that said, there are other ways to allow users to download from the server without using cURL. For instance, the PHP function readfile.