Install php 7 linux mint

Как установить PHP 7.3 / PHP 7.3-FPM на Linux Mint 19

Как мне установить PHP 7.3 на Linux Mint 19 ?

В декабре 2018 года команда PHP выпустила PHP 7.3 для общей доступности (GA), и все подробности о выпуске находятся на странице PHP ChangeLog. Версия PHP по умолчанию, доступная в репозиториях Linux Mint 19, — это PHP 7.2. Это руководство проведет вас через шаги по установке PHP 7.3 на Linux Mint 19. Для пользователей веб-сервера Apache вы установите libapache2-mod-php в качестве зависимости.

Но для пользователей Nginx вместо этого вы установите PHP 7.3-FPM.

Шаг 1: Обновите Linux Mint 19

Убедитесь, что вы используете обновленную версию Linux Mint. Если у вас запущены важные программы и вы не хотите их обновлять, вы можете просто обновить список пакетов. Рекомендуется перезагрузить компьютер после обновления, если у вас установлена более новая версия ядра.

Шаг 2: Добавьте репозиторий PHP 7.3 в Linux Mint 19

Поскольку Linux Mint 19 основан на Ubuntu 18.04, добавляемый репозиторий предназначен для Ubuntu 18.04. Добавьте ondrej / php PPA-репозиторий с пакетами PHP 7.3 и другими необходимыми расширениями PHP.

Шаг 3: Установите PHP 7.3 на Linux Mint 19

После добавления репозитория установите PHP, выполнив следующие команды на своем терминале. Версию можно проверить с помощью команды php.

Шаг 4: Установка расширений PHP 7.3

Установите расширения PHP 7.3, используя синтаксис Смотрите пример ниже Вы можете подтвердить установленную версию расширения php с помощью команды apt policy: Конфигурационный файл PHP для настройки среды: /etc/php/7.3/cli/php.ini и /etc/php/7.3/apache2/php.ini.

Установка PHP7.3 FPM на Linux Mint

Если вы используете Nginx Web Server, вам нужно установить php7.3-fpm для страниц PHP. Файлы конфигурации PHP-FPM доступны в папке /etc/php/7.3/fpm/ Вам может потребоваться перезагрузить ваш веб-сервер после установки PHP.

Счастливой PHP-разработки и хостинга приложений. Источник

How to Install PHP 7.2 on Linux Mint 19

Install PHP 7.2 on Linux Mint 19

PHP has different versions 5.6, 7.0, 7.1 and 7.2. Currently, PHP 7.2 is the latest version of it. PHP 7.2 offers much better performance and faster request processing and some security updates. Linux Mint 19 ships with PHP 7.0 which will no longer receive security updates so you should migrate from PHP 7.0 to PHP 7.2. In this tutorial, you will learn to install PHP 7.2 on Linux Mint 19.

Prerequisites

Before you start to install PHP on Linux Mint 19. You must have the non-root user account on your server with sudo privileges

1. Installing PHP on Debian

To install PHP 7.2 on Linux Mint 19, First, you will need to install some missing packages so you can add a new repository over HTTPS. Then you will add GPG keys after you will install PHP. Update the package manager index by typing following in the terminal

Now add missing package so you can add a new repository over HTTPS. An import signing key and enable PPA for PHP 7.2 by using the following command. Now update the package manager index again and install PHP 7.2 in Debian. Confirm the installation and check the version of PHP by typing:

2. Setup PHP for Nginx

Nginx by default does not support native PHP processing. You will need to install “fastCGI process manager”. Run the following command to install php-fpm on your server. You can check the status where it is correctly installed or not by the following command After installing the php-fpm package you will need to restart the Nginx server. To restart Nginx server run following command

you can check PHP version by running following command

3. Installing PHP With Apache

If you are running Apache at backend then you need to install PHP and Apache PHP module on the server. To install PHP 7.2 and apache module type following command and press enter. After installing the PHP and apache-php module you will need to restart the Apache server by typing the following command.

4. Install PHP Extensions

You will need to install some basic PHP extensions to run WordPress, Laravel like frameworks on the server. To install any of the PHP extensions on the server following is the basic format You can install a curl extension for PHP by running the following command. The following are some basic PHP extensions that need to be installed on your server. To install more extensions you can use the above format.

5. Testing PHP processing

To test PHP is configured on your server properly or not you should create a file test.php inside directory /var/www/html/ with following code. If you see the following output at https://YOUR_DOMAIN_NAME/test.php then you have installed PHP successfully.

Conclusion

You have installed PHP 7.2 on Linux Mint 19 successfully with some of its basic extensions and tested successfully. If you have any of the queries regarding this then don’t forget to comment below. Источник

How To Install PHP 7.3 / PHP 7.3-FPM on Linux Mint 19

How can I install PHP 7.3 on Linux Mint 19?. In December 2018, the PHP team released PHP 7.3 for general availability (GA) and all the release details are on the PHP ChangeLog page. The default version of PHP available in Linux Mint 19 repositories is PHP 7.2. This guide will walk you through the steps to install PHP 7.3 on Linux Mint 19. For Apache web server users, you’ll install libapache2-mod-php as a dependency. But for Nginx users, you’ll install PHP 7.3-FPM instead .

For other operating systems, use:

Step 1: Update Linux Mint 19

Ensure you’re running an updated version of Linux Mint. If you have important programs running and don’t want to upgrade them, you can just do an update for packages list. It is recommended to reboot after upgrade in case you have a newer version of Kernel installed.

Step 2: Add PHP 7.3 repository to Linux Mint 19

Since Linux Mint 19 is a based on Ubuntu 18.04, the repository to be added is for Ubuntu 18.04. Add ondrej/php PPA repository which has PHP 7.3 packages and other required PHP extensions.

Step 3: Install PHP 7.3 on Linux Mint 19

Once the repository has been added, install PHP by running the commands below on your terminal. Version can be checked using the php — command.

Step 4: Installing PHP 7.3 Extensions

Install PHP 7.3 extensions by using the syntax You can confirm installed version of PHP extension using apt policy command : PHP configuration file for setting up the environment are /etc/php/7.3/cli/php.ini and /etc/php/7.3/apache2/php.ini .

Installing PHP7.3-FPM on Linux Mint

If you’re using Nginx Web Server, you’ll need to install php7.3-fpm for serving PHP pages. PHP-FPM configurations files are available under the folder /etc/php/7.3/fpm/ You may need to restart your Web server after installation of PHP. Have a happy PHP development and Applications hosting.

barbotkin / install_php7_lamp.sh

#! /bin/bash
# PHP 7 Initial Compile (Install php7 Linux (Mint/Ubuntu) LAMP) ##
# Author: Roman Barbotkin
# Fixed error and simplified, I tested for Linux Mint 7.3.
# Install: just run this file, it will do everything for you 🙂
# If make error uncoments 2 line.
# sudo apt-get purge make
# sudo apt-get install make
# Fix error gmp.h
# sudo rm /usr/include/gmp.h
# sudo ln -sf /usr/include/i386-linux-gnu/gmp.h /usr/include/gmp.h
sudo apt-get install build-essential libt1-dev bison libbz2-dev libjpeg62-dev libpng12-dev libfreetype6-dev libgmp3-dev libmcrypt-dev libmysqlclient-dev libpspell-dev librecode-dev apache2-dev git
# Obtain latest source
git clone https://github.com/php/php-src
cd php-src
./buildconf
# Configure php7 source code
./configure \
—prefix=/usr \
—with-config-file-path=/etc/php7/apache2 \
—with-config-file-scan-dir=/etc/php7/apache2/conf.d \
—enable-mbstring \
—enable-zip \
—enable-bcmath \
—enable-pcntl \
—enable-ftp \
—enable-exif \
—enable-calendar \
—enable-sysvmsg \
—enable-sysvsem \
—enable-sysvshm \
—enable-wddx \
—with-curl \
—with-mcrypt \
—with-iconv \
—with-gmp=/usr/include/x86_64-linux-gnu \
—with-pspell \
—with-gd \
—with-jpeg-dir=/usr \
—with-png-dir=/usr \
—with-zlib-dir=/usr \
—with-xpm-dir=/usr \
—with-freetype-dir=/usr \
—enable-gd-native-ttf \
—enable-gd-jis-conv \
—with-openssl \
—with-pdo-mysql=/usr \
—with-gettext=/usr \
—with-zlib=/usr \
—with-bz2=/bin \
—with-recode=/usr \
—with-mysqli=/usr/bin/mysql_config \
—with-apxs2 \
—enable-dtrace
# PHP 7 does not recognize these without additional parameters or symlinks for
sudo ln -sf /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
sudo make
sudo make test
# Install it accoridng to the configured path.
sudo make install
# It’s own make script said to do this, but it didn’t do much on my system.
libtool —finish ./libs
# Work on non-threaded version as compiled for now.
sudo a2dismod mpm_worker
sudo a2enmod mpm_prefork
sudo a2dismod php5
sudo a2enmod php7
# Restart Apache if all went well.
sudo service apache2 start
cat EOF >> php7.conf
SetHandler application/x-httpd-php
SetHandler application/x-httpd-php-source
# Deny access to raw php sources by default
# To re-enable it’s recommended to enable access to the files
# only in specific virtual host or directory
Order Deny,Allow
Deny from all
# Deny access to files without filename (e.g. ‘.php’)
Order Deny,Allow
Deny from all
# Running PHP scripts in user directories is disabled by default
#
# To re-enable PHP in user directories comment the following lines
# (from to .) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
php_admin_flag engine Off
EOF
sudo cp php7.conf /etc/apache2/mods-available
sudo service apache2 start
php -v

You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. Источник