Quick Install Instructions of php-ctype on Ubuntu Server. It’s Super Easy! simply click on Copy button to copy the command and paste into your command line terminal using built-in APT package manager.
See below for quick step by step instructions of SSH commands, Copy/Paste to avoid miss-spelling or accidently installing a different package.
Quick Install Steps:
Step 1
Step 2
sudo apt-get install -y php-ctype
Step 3
Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on
your servers and more. The apps run in docker containers, to learn more
see ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.
Execute the commands above step by step. You can simply hit the copy button to copy the command and paste into the command line interface.
Note: -y flag means to assume yes and silently install,
without asking you questions in most cases.
Detailed Instructions:Step 1
Run update command to update package repositories and get latest package information.
Step 2Run the install command with -y flag to quickly install the packages and dependencies.
sudo apt-get install -y php-ctype
Step 3 Check the system logs to confirm that there are no related errors. You can use ZoomAdmin to check the logs, manager servers, host multiple websites and apps on your servers and more. The apps run in docker containers, to learn more
see
ZoomAdmin Features for list of features and demo videos. And you can start with the Free Plan.
Laravel Server Requirements mention that BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, and XML extensions are required. Most of the extensions are installed and enabled by default.
You can run the following command in Ubuntu to make sure the extensions are installed.
sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zipPHP version specific installation (if PHP 7.4 installed)
sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstringYou may need other PHP extensions for your composer packages. Find from links below.
PHP extensions for Ubuntu 20.04 LTS (Focal Fossa)
PHP extensions for Ubuntu 18.04 LTS (Bionic)
PHP extensions for Ubuntu 16.04 LTS (Xenial)
In this tutorial, you will learn how to install PHP 7.1/7.2/7.3/7.4 on Ubuntu 22.04. PHP is a fast, flexible, pragmatic, popular general-purpose scripting language that is especially suited to web development.
The default Ubuntu 22.04 repositories provide PHP 8.x;
apt-cache policy phpphp: Installed: (none) Candidate: 2:8.0+82~0build1 Version table: 2:8.0+82~0build1 500 500 //us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages 500 //us.archive.ubuntu.com/ubuntu jammy/main i386 PackagesInstall SURY APT Repository
To install PHP 7.1/7.2/7.3/7.4 on Ubuntu 22.04, you need to install SURY, third party repositories that provides PHP packages.
add-apt-repository ppa:ondrej/php --yes &> /dev/nullRun System Update
Re-synchronize your system packages to the latest versions;
apt updateInstall PHP 7.4 on Ubuntu 22.04
Once the SURY repos are in place, you should now be able to install PHP 7.4 on Ubuntu 22.04 by running the command below;
apt install php7.4Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libapache2-mod-php7.4 libffi7 libpcre2-8-0 php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline Suggested packages: php-pear The following NEW packages will be installed: libapache2-mod-php7.4 libffi7 php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline The following packages will be upgraded: libpcre2-8-0 php-common 2 upgraded, 8 newly installed, 0 to remove and 736 not upgraded. Need to get 4,365 kB of archives. After this operation, 18.0 MB of additional disk space will be used. Do you want to continue? [Y/n] yInstall PHP 7.4 Modules on Ubuntu 22.04
By default, quite a number of PHP 7.4 modules are already enabled.
php7.4 -m[PHP Modules] calendar Core ctype date exif FFI fileinfo filter ftp gettext hash iconv json libxml openssl pcntl pcre PDO Phar posix readline Reflection session shmop sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer Zend OPcache zlib [Zend Modules] Zend OPcacheTo install additional modules, first check if the modules is provided by the default repositories;
apt-cache search php7.4-EXTENSIONWhere EXTENSION is the PHP module you want to install. For example;
apt-cache search php7.4-mysqlIf the module is available, then install it using the command;
apt install php7.4-EXTENSIONFor example;
apt install php7.4-mysqlInstall PHP 7.3 on Ubuntu 22.04
Once the repository is in place, install PHP 7.3 on Ubuntu 22.04 by executing the command;
apt install php7.3To install PHP 7.3 modules, run the command;
apt install php7.3-EXTENSIONInstall PHP 7.2 on Ubuntu 22.04
To install PHP 7.2 on Ubuntu 22.04 by executing the command;
apt install php7.2To install PHP 7.2 modules, run the command;
apt install php7.2-EXTENSIONInstall PHP 7.1 on Ubuntu 22.04
Once the repository is in place, install PHP 7.1 on Ubuntu 22.04 by executing the command;
apt install php7.1To install PHP 7.1 modules, run the command;
apt install php7.1-EXTENSIONSet default PHP version on Ubuntu 22.04
If you have multiple versions of PHP installed on Ubuntu 22.04, you can choose to make one of the versions as the default PHP version.
To list the available versions;
update-alternatives --config phpSample command output;
There are 4 choices for the alternative php (providing /usr/bin/php). Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/bin/php8.1 81 auto mode 1 /usr/bin/php7.2 72 manual mode 2 /usr/bin/php7.3 73 manual mode 3 /usr/bin/php7.4 74 manual mode 4 /usr/bin/php8.1 81 manual mode Press to keep the current choice[*], or type selection number:As you can see, we have PHP 8.1 as the default version of PHP.
To change the default version, simply enter the number that matched the appropriate version you want to make as the default and press ENTER.
For example, to make PHP 7.4 as the default version, simply type 3 and press ENTER.
You can simply execute the command below to change the version straight away;
update-alternatives --set php /usr/bin/php7.4Checking the version;
php -vPHP 7.4.27 (cli) (built: Dec 20 2021 21:28:15) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.27, Copyright (c), by Zend TechnologiesAnd that is it on how to you can install PHP 7.1/7.2/7.3/7.4 on Ubuntu 22.04.
Other Tutorials
Install PHP 8 on Ubuntu 22.04
Install PHP 8 on Debian 11
Install MySQL 8 on Debian 11
Install MariaDB 10.6 on Debian 11