Skip to end of metadataGo to start of metadata
![Install php extensions windows Install php extensions windows](/uploads/1/2/5/8/125849091/106029002.jpg)
Overview
I have installed PHP 7 and MySQL 5.5.47 on Ubuntu 14.04 (Trusty Tahr). I have checked installed extension using: sudo apt-cache search php7-. It outputs: php7.0-common - Common files for. Calendar, Add support for calendars (not using mcal!). To install extensions, first decide which versions of PHP to compile the extensions for. This is done.
EasyApache 4 allows the use of multiple versions of PHP. This document explains how to locate and install a PHP version or a PHP extension.
Determine a user's PHP version
You can determine a user's PHP version with one of the following methods:
- Use WHM's MultiPHP Managerinterface (WHM >> Home >> Software >> MultiPHP Manager). This interface allows you to see and change a user's default PHP version. This is the easiest method to determine a user's PHP version.
- Use cPanel's MultiPHP Managerinterface (cPanel >> Home >> Software >> MultiPHP Manager).
- Navigate to the contents of the user's home directory, located at
/home/username/public_html
, whereusername
represents the user's username. Enter the following command on the command line:You will receive output that resembles the following example:In the above example,# Use php70 as default
indicates that the site uses PHP 7.0.
- Use the WHM API 1 Functions - php_get_vhost_versions API call.
- Use the UAPI Functions - LangPHP::php_get_vhost_versions API call.
Install a PHP version
EasyApache 4 supports PHP versions 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, and 7.3.
- The cPanel default profile includes PHP versions 7.1, 7.2, and 7.3.
- PHP versions 7.0 and earlier are deprecated. After deprecation, they may not appear as options in some cPanel & WHM interfaces.
Note:
EasyApache adheres to the php.net supported versions timeline. The profiles that we supply in WHM's EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4) only provide PHP versions that php.net currently supports.
RPMs for unsupported versions of PHP will remain the cPanel, L.L.C mirrors and servers, but we will not provide any further updates.
You can install a PHP version on your system with one of the following methods:
- Use WHM's EasyApache 4interface (WHM >> Home >> Software >> EasyApache 4) to select the version of PHP that you wish to load.
Note:
You can only install cPanel-provided PHP packages in the EasyApache 4 interface. You must use yum to install custom PHP packages.
- Use the
yum install
command to install your desired PHP version. For more information about yum, read our Yellowdog Updater, Modified (yum) Basics documentation. You can select from the following PHP packages:Important:We deprecated PHP 5.6 and PHP 7.0 in cPanel & WHM version 84. We will remove them in a future version. For more information, read our cPanel Deprecation Plan documentation.ea-php54
ea-php55
ea-php56
ea-php70
ea-php71
ea-php72
inherit
- Any custom PHP package name.
Vendor-provided PHP versions
In cPanel & WHM version 66 and later, EasyApache 4 allows you to use PHP versions that cPanel, L.L.C. does not provide. These PHP versions must be a Software Collection Library (SCL) package and cannot start with theea-
prefix that EasyApache 4 uses. - You cannot use the EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4) to install vendor-provided versions of PHP. You must use yum to install these packages on your system. For more information, read our Yellowdog Updater, Modified (yum) Basics documentation.
- After you install the packages, you can use WHM's MultiPHP Manager interface (WHM >> Home >> Software >> MultiPHP Manager) and WHM's MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor) to make changes.
Important:
- The DSO PHP handler is not available with Red Hat® Enterprise Linux® (RHEL) and CloudLinux™ PHP packages.
- SCL PHP packagesrequire a vendor prefix in orderto install in EasyApache 4. For example, you cannot use RHEL PHP versions 5.4 or 5.5 because these packages do not begin with a vendor prefix.
- Not all vendor-provided PHP packages will contain all of the files that EasyApache 4's MultiPHP system requires. You may experience additional limitations.
Potential issues
Some potential issues exist in vendor-provided versions of PHP.
Vendor-provided php.ini does not exist
In some cases, a vendor-provided PHP version's
php.ini
file will not exist in the directory that cPanel & WHM requires. For example, RHEL's PHP 5.6 .ini
file exists in the /opt/rh/rh-php56/register.content/etc/opt/rh/rh-php56
directory, but cPanel & WHM expects it in the /opt/rh/rh-php56/root/etc
directory. You must create a symlink in order for the MultiPHP system to read the php.ini
file.To create the symlink, use the following command, where
php56
represents the PHP version that you wish to use:![Install php extensions windows Install php extensions windows](/uploads/1/2/5/8/125849091/106029002.jpg)
If you installed the PHP version before you created the symlink, you must reinstall the PHP version with the following command, where
php56
represents the PHP version that you wish to use:PHP CLI and PHP CGI binaries in different locations
Some PHP versions include the PHP CLI and PHP CLI binaries in different locations than cPanel & WHM's implementation. In these cases, the PHP installation reverses the location of these binaries. If your PHP version does this, then the following issues may occur:
- The
php-cgi
binary path will not exist. - The
php-cli
binary path will be incorrect.
To fix this issue, use the following commands, where
prefix
represents the vendor prefix and package
represents the package name:Find a PHP module or extension
You can find a PHP module or extension with one of the following methods:
- Use WHM'sEasyApache 4interface (WHM >> Home >> Software >> EasyApache 4).
- Run the
rpm -qa | grep -i
package
command, wherepackage
represents part of the name of the package that you wish to install, to determine if the package is already installed. - Run the
yum list package
command, wherepackage
represents part of the name of the package that you wish to install, to determine if the package is available.
Install a PHP module or extension
EasyApache 4's packages for PHP modules and extensions use the
ea-php##-php-module
naming convention, where ##
represents the PHP version number and module
represents the name of the PHP module. Install a PHP module or extension on your system with one of the following methods:
- Use WHM'sEasyApache 4interface (WHM >> Home >> Software >> EasyApache 4).
- Install the package on the command line with the following command:
The above example installs the
ea-php56-php-gd
package, where 56
represents the PHP version and gd
represents the extension name.Important:
You must install the extension separately for each PHP version. However, in cPanel & WHM version 70 and above, the system attempts to simplify this process. When you install a newer version of PHP, the system automatically selects the extensions used with your older versions, if compatible.
Additional documentation
Content by labelThere is no content with the specified labels
Content by labelThere is no content with the specified labels
Content by labelThere is no content with the specified labels
- PHP Tutorial
- Advanced PHP
- PHP Form Examples
- PHP login Examples
- PHP AJAX Examples
- PHP XML Example
- PHP Frame Works
- PHP Design Patterns
- PHP Function Reference
- PHP Useful Resources
- Selected Reading
The calendar extension presents a series of functions to simplify converting between different calendar formats.
The intermediary or standard it is based on is the Julian Day Count. The Julian Day Count is a count of days starting from January 1st, 4713 B.C. To convert between calendar systems, you must first convert to Julian Day Count, then to the calendar system of your choice.
Installation
To get these functions to work, you have to compile PHP with --enable-calendar.
Runtime Configuration
This extension has no configuration directives defined in php.ini.
PHP Calendar Constants
Sr.No | Constant & Description | PHP |
---|---|---|
1 | CAL_GREGORIAN Gregorian calendar | 3 |
2 | CAL_JULIAN Julian calendar | 3 |
3 | CAL_JEWISH Jewish calendar | 3 |
4 | CAL_FRENCH French Republican calendar | 3 |
5 | CAL_NUM_CALS | 3 |
6 | CAL_DOW_DAYNO | 3 |
7 | CAL_DOW_SHORT | 3 |
8 | CAL_DOW_LONG | 3 |
9 | CAL_MONTH_GREGORIAN_SHORT | 3 |
10 | CAL_MONTH_GREGORIAN_LONG | 3 |
11 | CAL_MONTH_JULIAN_SHORT | 3 |
12 | CAL_MONTH_JULIAN_LONG | 3 |
13 | CAL_MONTH_JEWISH | 3 |
14 | CAL_MONTH_FRENCH | 3 |
15 | CAL_EASTER_DEFAULT | 4 |
16 | CAL_EASTER_DEFAULT | 4 |
17 | CAL_EASTER_ROMAN | 4 |
18 | CAL_EASTER_ALWAYS_GREGORIAN | 4 |
19 | CAL_EASTER_ALWAYS_JULIAN | 4 |
20 | CAL_JEWISH_ADD_ALAFIM_GERESH | 5 |
21 | CAL_JEWISH_ADD_ALAFIM | 5 |
22 | CAL_JEWISH_ADD_GERESHAYIM | 5 |
List of Functions
PHP − indicates the earliest version of PHP that supports the function.
Sr.No | Function & Description | PHP |
---|---|---|
1 | cal_days_in_month() Returns the number of days in a month for a specified year and calendar | 4 |
2 | cal_from_jd() Converts a Julian day count into a date of a specified calendar | 4 |
3 | cal_from_jd() Returns information about a given calendar | 4 |
4 | cal_to_jd() Converts a date to Julian day count | 4 |
5 | easter_date() Returns the Unix timestamp for midnight on Easter of a specified year | 3 |
6 | easter_days() Returns the number of days after March 21, on which Easter falls for a specified year | 3 |
7 | FrenchToJD() Converts a French Republican date to a Julian day count | 3 |
8 | GregorianToJD() Converts a Gregorian date to a Julian day count | 3 |
9 | JDDayOfWeek() Returns the day of a week | 3 |
10 | JDMonthName() Returns a month name | 3 |
11 | JDToFrench() Converts a Julian day count to a French Republican date | 3 |
12 | JDToGregorian() Converts a Julian day count to a Gregorian date | 3 |
13 | jdtojewish() Converts a Julian day count to a Jewish date | 3 |
14 | JDToJulian() Converts a Julian day count to a Julian date | 3 |
15 | jdtounix() Converts a Julian day count to a Unix timestamp | 4 |
16 | JewishToJD() Converts a Jewish date to a Julian day count | 3 |
17 | JulianToJD() Converts a Julian date to a Julian day count | 3 |
18 | unixtojd() Converts a Unix timestamp to a Julian day count | 4 |