Report this

What is the reason for this report?

How to install these technologies on my server?

Posted on June 28, 2019

How can I install it on my server?

PHP >= 7.1.3 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension XML PHP Extension Ctype PHP Extension JSON PHP Extension BCMath PHP Extension



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

I think that this would work for you:

First make sure to run apt updage:

apt-get update

Then run the follwoing to install your PHP modules:

apt-get install php7.2 php7.2-curl php7.2-dev php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml php-token-stream php7.2-json

Hope that this helps! Bobby

To install PHP and the required PHP extensions on your server, you’ll need to follow specific steps depending on the operating system of your server. Below, I’ll provide guidance for installing PHP and the necessary extensions on both Ubuntu (commonly used with Debian as well) and CentOS, two of the most popular Linux distributions for web servers.

For Ubuntu/Debian-based systems:

  1. Update Your Package Manager
sudo apt update
sudo apt upgrade
  1. Install PHP and Common Extensions You mentioned the need for PHP version 7.1.3 or higher. I recommend installing a more current version of PHP, such as PHP 7.4 or PHP 8.0, as they offer better performance and security improvements. Here’s how you can install PHP 8.0 and the required extensions:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.0
sudo apt install php8.0-cli php8.0-fpm php8.0-mbstring php8.0-xml php8.0-bcmath php8.0-json php8.0-pdo php8.0-tokenizer php8.0-ctype php8.0-openssl

Check Installation Verify that PHP and its extensions are installed correctly:

php -v
php -m

For CentOS/RHEL-based systems:

  1. Enable EPEL and Remi Repository To install the latest PHP versions, you need the EPEL and Remi repositories:
sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php80

Install PHP and Extensions Now, install PHP 8.0 and the necessary extensions:

sudo yum install php php-cli php-fpm php-mbstring php-xml php-bcmath php-json php-pdo php-tokenizer php-ctype

Additional Configuration

  • Configure PHP-FPM for use with your web server (either Apache or Nginx):

    • If using Apache, you might need to install and configure libapache2-mod-php (for Ubuntu) or mod_php (for CentOS).
    • If using Nginx, ensure that PHP-FPM is properly set up to handle PHP processing, as Nginx does not process PHP natively.
  • Adjust PHP Settings in php.ini (located usually in /etc/php/8.0/cli/php.ini for CLI and /etc/php/8.0/fpm/php.ini for FPM):

    • Customize settings such as upload_max_filesize, post_max_size, memory_limit, and max_execution_time as per your application requirements.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.