Loading...

Installing OCI8 & PHP 7.2 on RHEL or CentOS 6

View: 390    Dowload: 0   Comment: 0   Post by: admin   Category: Php&mySql   Fields: Other

Introduction

In response to my extremely (thousands of hits) popular article Installing OCI8 on RHEL, I decided to add this article since I find those instructions have become somewhat out of date, and also it is recommended to use PHP 7.2 with any web application that you are currently supporting. PHP 7.2 provides significant performance improvements over PHP 7.0, so if you are using PHP 7.0, I highly recommend updating to PHP 7.2.

Stopping Apache

You’ll need to stop Apache (web server) using the following command. In any Linux commands I show in this article, it presumes you aren’t logged in as the root user, so you will need to use sudo to issue privileged commands.

sudo service httpd stop

Add EPEL & Remi Repositories

You’ll need to install the EPEL & Remi repositories as follows:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm

Set Config Manager for PHP 7.2

You’ll need to get the yum-utils to use the yum-config-manager to set the default repository using the following commands:

sudo yum install yum-utils
sudo yum-config-manager --enable remi-php72

The above enables the Remi PHP 7.2 repository.

Installing PHP 7.2

If you already have PHP 5.x or PHP 7.0 installed, you will need to figure out how to remove it. I used this command to remove php70u from my system(s):

sudo yum remove php70u-common.x86_64

You can then check to see if you still have php installed with this command:

sudo yum list installed |grep php

You shouldn’t see anything related to php installed, otherwise uninstall the package.

Then you can install PHP 7.2; in my scenario, I normally develop Symfony applications that use PHP in Apache. In my case I would use the following command to install:

sudo yum install php php-pecl-mcrypt php-cli php-gd php-curl php-mysqlnd php-ldap php-zip php-fileinfo php-xml php-intl php-mbstring php-opcache php-process systemtap-sdt-devel php-pear php-json php-devel php-common php-bcmath php-pdo

This installs all the packages I need.

Installing OCI8

This is the part that could get tricky. You should be able to issue the following at this point:

sudo install php-oci8

Then you’ll need to edit the php.ini file as follows:

sudo vi /etc/php.ini

Which is the typical location of the php.ini file. In Symfony, look at the “View phpinof()” link, and then look for the “Loaded Configuration File”, which shows the file you need to edit. Then at the bottom of this file add this line:

extension=oci8.so

Then in vi, issue the command “:wq!” to save the file and quit. Then to check if php is installed correct, issue this command:

php -v

If you see errors like unable to load dynamic link library oci8.so, then you probably need to reinstall Oracle Instant Client or you haven’t installed it.

Installing Oracle Instant Client

You need to download for your Linux client, for example the following 2 files:

oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm

Make sure they are in your home directory, then install with the following commands:

sudo yum install oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
sudo yum install oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm

sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig

Then issue the following command to verify PHP is installed correctly:

php -v

You should see no error and version PHP 7.2 shown.

Verifying OCI8 & PHP 7.2 on Web Server

You’ll need to restart your Apache web server:

sudo service httpd restart

Then in Symfony look at the “View phpinfo()” link. Or create your own using this code:

<? phpinfo(); ?>

Then search on the page for the string “oci8”, you should see something like the following image:

OCI8 Shown in PHPInfo

Installing OCI8 & PHP 7.2 on RHEL or CentOS 6

You’ll need to stop Apache (web server) using the following command. In any Linux commands I show in this article, it presumes you aren’t logged in as the root user, so you will need to use sudo to issue privileged commands.

Posted on 20-02-2018 

Comment:

To comment you must be logged in members.

Files with category

  • Twitter-like Hashtag Function in PHP

    Twitter-like Hashtag Function in PHP

    View: 0    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    If you ever want a function to hashtag and style words within a string which has '#' next to it like twitter. This piece of code will help

  • PSITS Automated Voting System

    PSITS Automated Voting System

    View: 24    Download: 3   Comment: 0

    Category: Php&mySql     Fields: none

    A free sourcecode for PSITS Automated Voting System develop in PHP programming language. The purposed of the system is to automate the process of voting and maintain the quality of data

  • PHP-University Application System

    PHP-University Application System

    View: 30    Download: 6   Comment: 0

    Category: Php&mySql     Fields: none

    Greeting from Malawi the warm heart of Africa. I developed this university registration system project just to share with the people who can make use of the project like this and at the same time for others like students who can learn from it. This...

  • School Event Management System in PHP/MSQLi

    School Event Management System in PHP/MSQLi

    View: 22    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    This School Event Management System can create school events such as Volleyball games, Basketball, Cultural presentation, Election of school officers etc . During school election Instead of having a compile list of candidates and voters this system...

  • Resort Reservation System with PayPal/Credit Card/Debit Card Payment

    Resort Reservation System with PayPal/Credit Card/Debit Card Payment

    View: 27    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    This reservation system has the ability to help its customers find available rooms, cottages and even function hall for their convenience . And in here, they will also have the idea of the room rates where they can quickly reserve for their family...

  • Activity log

    Activity log

    View: 20    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    Simple program to track user's activity log-in time and online/offline status.

  • Electricks - eCommerce

    Electricks - eCommerce

    View: 22    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    Electricks is an e-commerce website built using PHP, Bootstrap and some jQuery plugins. It has all the major functionalities of a typical e-shop. This project was used to present in Southern Luzon State University - Lucban. Feel free to use this code...

  • Simple Email App Using PHP

    Simple Email App Using PHP

    View: 18    Download: 0   Comment: 0

    Category: Php&mySql     Fields: none

    Creating a simple PHP script using mail function for sending out emails.

 
File suggestion for you
Loading...
File top downloads
Loading...
Loading...
Codetitle - library source code to share, download the file to the community
Copyright © 2018. All rights reserved. codetitle Develope by Vinagon .Ltd