PHP / PHP-FPM latest version 7.2.9 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04

PHP / PHP-FPM latest version 7.2.9 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04 1

 PHP / PHP-FPM latest version 7.2.9 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04

PHP-FPM latest version 7.2.9 was as of late discharged which incorporates few bug settles… This concise instructional exercise demonstrates to understudies and new clients industry standards to introduce or update PHP/PHP-FPM on Ubuntu 16.04/18.04 LTS servers…

In case you will build up any PHP application, you’re for the most part going to require PHP and related modules introduced. PHP/PHP-FPM is an open source server scripting dialect use for making dynamic web applications and sites.

PHP/PHP-FPM is a generally utilized, free, and proficient contrasting option to contenders, for example, Microsoft’s ASP… . Most well known substance administration frameworks like WordPress, Joomla, Drupal utilize PHP or PHP-FPM to work… .

For additional about this discharge, if you don’t mind check its changelog page… .

PHP is utilized with Apache2 HTTP server

PHP-FPM is utilized with Nginx HTTP server

When you’re prepared to set up PHP with Apache2 or PHP-FPM with Nginx, take after the means below:Below is a rundown of a portion of the bug fixes with this discharge:

  • Logbook:

Settled bug (jewish.c: order blunder under Windows with GBK charset).

  • Channel:

Settled bug (References in sub-exhibit for separating breaks the channel).

  • PDO_Firebird:

Settled bug (Memory spill while getting a BLOB field).

  • PDO_PgSQL:

Settled bug (Possible Memory Leak utilizing PDO::CURSOR_SCROLL alternative).

  • SQLite3:

Settled bug (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn’t juggle).

  • Standard:
  1. Settled bug (Incorrect sections in get_html_translation_table).
  2. Settled bug (array_column: invalid qualities in $index_key move toward becoming increasing keys in result).
  3. Settled bug (Segmentation blame when utilizing `output_add_rewrite_var`).
  • Zip:
  1. Settled bug (ZipArchive memory spill (OVERWRITE banner and void chronicle)).

Stage 1: Setup PHP with Apache2 HTTP Server

To utilize PHP with Apache2 HTTP server, you should first introduce Apache2… To do that, run the charges beneath:

sudo apt update
sudo apt install apache2

Subsequent to introducing Apache2, the orders underneath can be utilized to stop, begin and empower Apache2 administration to dependably startup when the server boots up.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

Stage 2: Setup PHP-FPM with Nginx HTTP server

To utilize PHP-FPM with Nginx HTTP server, you should first introduce Nginx… To do that, run the charges beneath:

sudo apt update
sudo apt install nginx

Subsequent to introducing Nginx, the orders underneath can be utilized to stop, begin and empower Nginx administration to dependably startup when the server boots up.

sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service

Stage 3: Install PHP 7.2 with Apache2 Support

PHP 7.2 may not be accessible in Ubuntu default stores… with a specific end goal to introduce it, you should get it from outsider storehouses.

Run the orders underneath to include the beneath outsider storehouse to move up to PHP/PHP-FPM 7.2

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php

At that point refresh and move up to PHP 7.2

sudo apt update

Next, run the orders underneath to introduce PHP 7.2 and related modules.

There are numerous PHP modules that perform distinctive capacities… . be that as it may, these are some mainstream ones that might be required when creating PHP based sites…

sudo apt-get install php7.2 libapache2-mod-php7.2 php7.2-cli php7.2-mysql php7.2-gd php7.2-imagick php7.2-recode php7.2-tidy php7.2-xmlrpc

The line above will enable PHP to work with numerous mainstream PHP based sites and applications.

Stage 4: Configure PHP 7.2 for Apache2

Since Apache2 and PHP are introduced, you might need to arrange Apache2 to utilize PHP legitimately. The default Apache2 PHP design record is situated at /etc/php/7.2/apache2/php.ini

Open PHP Apache2 design document by running the summons underneath

sudo nano /etc/php/7.2/apache2/php.ini

At that point alter the record to suit your surroundings. Some critical lines to consider:

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 64M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

Next, query Apache2 dir.conf document and affirm the line beneath:

<IfModule mod_dir.c>
     DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

In the event that you don’t see the index.php definition on hold, if it’s not too much trouble include it and spare the record.

Restart Apache2 and PHP administrations

sudo systemctl restart apache2.service

Stage 5: Install PHP-FPM 7.2 for Nginx

In case you’re running Nginx then the summons beneath ought to get PHP-FPM and related modules introduced… .

There are numerous PHP-FPM modules that perform diverse capacities… . nonetheless, these are some prevalent ones that might be required when creating PHP based sites…

sudo apt-get install php7.2-fpm php7.2-cli php7.2-mysql php7.2-gd php7.2-imagick php7.2-recode php7.2-tidy php7.2-xmlrpc

The line above will enable PHP to work with numerous well known PHP based sites and applications.

Stage 6: Configure PHP-FPM for Nginx

Since Nginx and PHP-FPM are introduced, you might need to arrange Nginx to utilize PHP-FPM legitimately. The default Nginx PHP-FPM design record is situated at  /etc/php/7.2/fpm/php.ini

Open PHP Apache2 setup document by running the summons beneath

sudo nano /etc/php/7.2/fpm/php.ini

At that point alter the record to suit your surroundings. Some critical lines to consider:

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 64M
cgi.fix_pathinfo = 0
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

Spare the record and exit… .

Now Apache2 or Nginx with PHP or PHP-FPM ought to be introduced and prepared to utilize.. you can test PHP/PHP-FPM settings by making a clear document… ..

sudo nano /var/www/html/phpinfo.php

At that point include the line in the document and spare.

<?php phpinfo( ); ?>

Spare the record and open your program and peruse to the server name or IP address taken after by phpinfo.php

You should see something like the picture beneath… on the off chance that you do, at that point you’re all great!

php configuration file ubuntu

Congratulations! You’ve successfully installed and configured Apache2 / Nginx with PHP / PHP-FPM support on Ubuntu servers

 

1 thought on “PHP / PHP-FPM latest version 7.2.9 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04

Leave a Reply

Your email address will not be published. Required fields are marked *