This actually depends on the packages available in the APT sources. First, update the APT packages using apt-get update.
Then type apt-get install php and press tab twice. It will ask for a confirmation to display the whole list like Display all n possibilities? (y or n): where N is the available number of possibilities.
Press Y and you'll get a long list of available packages, out of which you can find the package name that you want. O course, if you have a long list, this will be a little tedious. But still you can narrow it down based on the version.–Aug 18 '17 at 6:41. Other answers led me to the exact same conclusion. Let's say it's correct for Now, where other answers were correct for their own time. I'll verify that this works for Ubuntu 18.04, Apache 2. This is preferable to the simple 'php-curl' which attempts to load a PHP7.2 version, where (for me) I want to keep using 7.1.
Don't forget to restart the webserver. After this, where phpinfo used to show cURL just under the Module Authors section ( Sterling Hughes ), now cURL has it's own very detailed section, currently at 7.58.0.–Oct 2 '18 at 2:58.
At some point in time, you're probably going to have to recompile Apache and PHP. This is necessary any time you wish to upgrade to the latest version, enable or disable a module or feature, et cetera.WHM provides you with a convenient tool called EasyApache. This tool gives you the freedom to customize every little detail, if you want, or to choose from an existing configuration profile.1) Find the Software category of the menu.2) Click the EasyApache link.It will check for updates first, then should forward you to the user interface.If you'd like more information before using EasyApache, you can always read over the documentation, found using the links above.3) Select a profile from the list. Check out the More Info links if you'd like more details about each one.4) Click Build Profile Now if you'd like to go ahead and rebuild Apache and PHP without making any changes to the profile first.We're going to customize the Previously Saved Config.You can keep track of your progress and return to previous pages up here.5) Select the version of Apache you want to build.6) Click Next Step to proceed.7) Select the main versions of PHP you want to build; we'll be sticking with PHP 5. You can choose to install both - or neither - if you wish.8) Next Step.9) Now, select the minor version to build of each major PHP version.Typically, the latest version is best.10) Now, for the Short Options List. Work your way through the list, enabling or disabling whatever you want.
Be sure to enable only what you need; installing too many modules can cause performance issues.Assume that if an option on our screen is already enabled and we don't mention it, you should enable it on yours, if it isn't already.You'll have to confirm most options, but we won't show that for every one.The Frontpage Extensions for Apache have security issues and bugs. Frontpage itself has been discontinued since 2006.11) So, we'll turn Frontpage off.12) Mod SuPHP is a module for PHP similar to the suEXEC module for Apache.
It helps decrease the security risks involved with running PHP scripts. This option requires that PHP runs in CGI mode; enabling it will make the necessary changes automatically.13) The IonCube Loader for PHP is required to run some PHP programs having encrypted source code.14) ModSecurity is a web application firewall for Apache; it increases security by detecting and preventing attacks before they reach web applications. You'll be able to configure this in WHM later, once enabled.15) Suhosin is an advanced protection system for PHP, designed to protect servers and users from flaws in PHP itself.16) SourceGuardian is similar to IonCube.17) At the bottom of this page, you have the option to Save and Build your profile as it is now.18) Or, go to the Exhaustive Options List for further configuration options.19) First on this page is the list of Apache Built-in Modules.
You shouldn't need to enable or disable these any further than we did on the previous page, unless you're certain you need to do so.This is the only PHP-related module here; the core PHP modules can be enabled or disabled further down the page.20) Next is the Other Modules section. All of these were on the previous page, so let's skip down to the PHP section.Most of the changes you'll make on this page will probably be to the PHP options, shown here.
You should see a section like this for each version of PHP you'll be installing.21) cURL allows PHP scripts to connect to many different types of servers, such as web servers and FTP servers.Let's enable cURL and its SSL support (for encrypted connections).22) GD (or Graphics Draw) is a library of functions for PHP that allows programmers to create and manipulate images in a variety of different formats.Many PHP programs use this, so you should turn it on.23) The Zlib module for PHP is required to install GD.24) Mbstring allows PHP to handle working with ' multi-byte strings'. This module is required in order to work with alphabets other than Latin.25) Mcrypt enables a number of advanced encryption algorithms. A number of the algorithms are used by governments to protect Top Secret information.26) Closely related to Mcrypt is Mhash. Hashing algorithms are similar to encryption algorithms, with the key difference being that hashing is irreversible.27) Let's enable both of those.28) The MySQL 'Improved' extension provides programmers with more efficient access to a MySQL server and its databases. It should work with all recent versions of MySQL.
Click here to enable it.29) Enabling Safe PHP CGI prevents users from overriding your system PHP.ini settings when running PHP in CGI mode.30) Ticking the checkbox next to TTF (FreeType) gives the GD extension better font support.That's all of the options for PHP.Here are some preferences that you should not need to change, but can if you wish.31) If you want, you can use this form to save your settings as a custom profile that will be selectable with the rest of the profiles later on. If you don't fill out this form, your choices will still be saved as ' Previously Saved Config'.32) Click here to Save your profile without building it.33).or here to save and build your profile.34) Confirm.35) Acknowledge that you understand terminating the build process can cause data loss. Apache will be rendered unusable if this process is killed prematurely.You will be notified of any necessary adjustments to your configuration, then forwarded automatically to the build page.If anything goes wrong, the entire build log will be saved to the path shown above in bold for troubleshooting purposes.If you receive 'Out of memory' errors below, you will need to run the build manually by command line.
That's beyond the scope of this tutorial.