Install PHP7 under Ubuntu

Install PHP7 under Ubuntu

Since on Ubuntu 16.04, the default PHP version is 7.x. Since we want to use Apache2.4+PHP, we can directly parse PHP by installing the following modules.

sudo apt-get install php-dev libapache2-mod-php

In this way, the most basic modules are installed. If you need other modules, you can quickly install them through apt-get; for example, you also need MySQL and mb_string related modules.

sudo apt-get install php-mysql php-mbstring

This will automatically install the relevant modules.

Install the Oracle Client
Since we need to compile the OCI extension, we need the Oracle client. Here we download the Oracle Instant Client and select Instant Client for Linux x86-64 basicthe version to download.

In addition, to compile OCI, you must also need instant client SDKthe package. After downloading and decompressing, merge it into Base.
There are also installation steps at the end of the given web page, here is a brief description

  • Unzip the zip package and place it in a directory
  • Create a suitable link for the current version of Instant Client
  • set environment variables
sudo unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
sudo unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
sudo mv instantclient_12_1/ /opt/oracle/
cd /opt/oracle/instantclient_12_1/
# 建立符号链接
sudo ln -s libclntsh.so.12.1 libclntsh.so
sudo ln -s libocci.so.12.1 libocci.so
# 打开 /etc/profile 在最后面加入
export LD_LIBRARY_PATH=/opt/oracle/instantclient_12_1:$LD_LIBRARY_PATH
export PATH=/opt/oracle/instantclient_12_1:$PATH
# 最后source一下,使配置生效
source /etc/profile

Reprinted in: Detailed explanation of PHP installation process under Ubuntu16.04

Guess you like

Origin blog.csdn.net/Quiet_tomcat/article/details/90641175