How to install PHP 7.3 on FreeBSD 12

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Are you looking for an easy way to install PHP 7.3 on FreeBSD 12? My previous guide was to install PHP7.2 on FreeBSD 12. PHP is one of the most popular programming languages ​​supporting the Internet. PHP 7.3 can be used for general purposes and can be put into production. You can read more about the PHP 7.3 release notes to learn about new features and deprecated features.

I started to like FreeBSD as my web application hosting server. It is stable, safe, and has comprehensive documentation to help you get started immediately.

Please follow the steps provided in this article to install PHP 7.3 on the FreeBSD server. I will try to gradually install and configure various services on FreeBSD.

Step 1: Update the port tree

First use to update the Ports tree of the FreeBSD server. portsnap command. If you plan to install PHP 7.3 from source, you must do this.

# portsnap fetch update Looking up portsnap.FreeBSD.org mirrors… 6 mirrors found. Fetching public key from ec2-eu-west-1.portsnap.freebsd.org… done. Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org… done. Fetching snapshot metadata… done. Fetching snapshot generated at Sat Jan 26 00:07:39 UTC 2019:....Extracting snapshot… done. Verifying snapshot integrity… done. Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org… done. Fetching snapshot metadata… done. Updating from Sat Jan 26 00:07:39 UTC 2019 to Sat Jan 26 15:32:34 UTC 2019. Fetching 5 metadata patches… done. Applying metadata patches… done. Fetching 0 metadata files… done. Fetching 101 patches.  (101/101) 100.00%  done.                                     done. Applying patches…  done. Fetching 120 new ports or files… done. /usr/ports was not created by portsnap.

When running Portsnap for the first time, you need to unzip the snapshot into / usr / ports:

# portsnap extract

Step 2: Update the package repository

You can choose to install PHP 7.3 on FreeBSD 12 from the FreeBSD port or binaries. Since we will use the latter, we update the package repository directory.

# pkg update Updating FreeBSD repository catalogue… Fetching meta.txz: 100%    944 B   0.9kB/s    00:01     Fetching packagesite.txz: 100%    6 MiB 668.5kB/s    00:10     Processing entries: 100% FreeBSD repository update completed. 32066 packages processed. All repositories are up to date.

Step 3: Install PHP 7.3 on FreeBSD

You can install PHP 7.3 on FreeBSD in two ways.

  1. Install from binary package
  2. Install from source using port

Method 1: Install PHP 7.3 from FreeBSD on FreeBSD

Run the following command to install PHP 7.3 on FreeBSD from a binary file.

# pkg install php73 Updating FreeBSD repository catalogue… FreeBSD repository is up to date. All repositories are up to date. The following 3 package(s) will be affected (of 0 checked): New packages to be INSTALLED:     php73: 7.3.1     libargon2: 20171227_1     pcre2: 10.31 Number of packages to be installed: 3 The process will require 31 MiB more space. 4 MiB to be downloaded. Proceed with this action? [y/N]: y [1/3] Fetching php73-7.3.1.txz: 100%    3 MiB 858.4kB/s    00:04     [2/3] Fetching libargon2-20171227_1.txz: 100%   64 KiB  65.2kB/s    00:01     [3/3] Fetching pcre2-10.31.txz: 100%    1 MiB 400.8kB/s    00:03     Checking integrity… done (0 conflicting) [1/3] Installing libargon2-20171227_1… [1/3] Extracting libargon2-20171227_1: 100% [2/3] Installing pcre2-10.31… [2/3] Extracting pcre2-10.31: 100% [3/3] Installing php73-7.3.1… [3/3] Extracting php73-7.3.1: 100%

Confirm that the PHP version is installed.

# php -v PHP 7.3.1 (cli) (built: Jan 15 2019 01:15:01) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies

Install PHP 7.3 extension on FreeBSD

Extensions can be installed using syntax php73-. See the example below, which will install standard extensions.

# pkg install php73-curl php73-extensions php73-json php73-xml  php73-zip php73-intl php73-mysqli php73-pdo_mysql php73-pdo  php73-pear php73-soap php73-phar

Press to accept the package installation ÿ

New packages to be INSTALLED:     php73-curl: 7.3.1     php73-extensions: 1.0     php73-json: 7.3.1     php73-xml: 7.3.1     php73-zip: 7.3.1     php73-intl: 7.3.1     php73-mysqli: 7.3.1     php73-pdo_mysql: 7.3.1     php73-pdo: 7.3.1     php73-pear: 1.10.6     php73-soap: 7.3.1     php73-phar: 7.3.1     curl: 7.62.0     libnghttp2: 1.35.1     ca_root_nss: 3.41.1     php73-session: 7.3.1     php73-opcache: 7.3.1     php73-xmlwriter: 7.3.1     php73-xmlreader: 7.3.1     php73-dom: 7.3.1     php73-simplexml: 7.3.1     php73-ctype: 7.3.1     php73-posix: 7.3.1     php73-hash: 7.3.1     php73-filter: 7.3.1     php73-tokenizer: 7.3.1     php73-sqlite3: 7.3.1     sqlite3: 3.26.0     php73-pdo_sqlite: 7.3.1     php73-iconv: 7.3.1     libzip: 1.5.1     icu: 63.1_1,1     php73-zlib: 7.3.1 Number of packages to be installed: 33 The process will require 62 MiB more space. 14 MiB to be downloaded. Proceed with this action? [y/N]: y 

You can view the loaded modules in the following ways:

# php -m

Install PHP 7.3 from FreeBSD from the port

Change the working directory to the PHP 7.2 ports folder

# cd /usr/ports/lang/php73

Then build and install PHP 7.3

# make install clean

To install the PHP 7.3 extension on FreeBSD from the port, go to the extension port directory and run:

# cd /usr/ports/lang/php72-extensions/# make install clean

that’s it. You have now installed PHP 7.3 on the FreeBSD server.

Check out other FreeBSD tutorials:

How to install Webmin on FreeBSD 12

How to install pip Python package manager on FreeBSD 12

How to install Node.js 10 LTS and NPM on FreeBSD 12

How to install MariaDB 10.3 on FreeBSD 12

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sidebar