A
A
Alexey2016-07-01 14:12:34
linux
Alexey, 2016-07-01 14:12:34

How to add Oracle module to PHP in Linux Ubuntu Server?

There is Ubuntu Server 14.04 installed "by default", that is, PHP, which was out of the box, is installed

php -v
PHP 5.5.9-1ubuntu4.17 (cli) (built: May 19 2016 19:05:57)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

You need to connect to Oracle on the local network to another server.
To do this, installed Oracle Instant Client 12.1 from RPM as mentioned here .
SqlPlus connects, everything is fine. But I need access from PHP. Here is the hardest part for me.
The oci_connect function is not defined:
php > $conn = oci_connect('user', 'password', 'orcl');
PHP Fatal error:  Call to undefined function oci_connect() in php shell code on line 1

php_info () command mentions OCI and OCI8 only in the "Module Authors" section.
According to this manual , it’s too late to do it, because. installed the oracle client from RPM, but read about pecl in this article and tried to install:
sudo pecl install oci8
pecl/oci8 requires PHP (version >= 7.0.0), installed version is 5.5.9-1ubuntu4.17
No valid packages found
install failed

Can someone, if they have free time, explain to me how can I rebuild PHP with the OCI (or OCI8) module?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-07-01
@Leshgan

Understood. I'll post it here if anyone needs it.
The pecl page says:
Use 'pecl install oci8-2.0.11' to install OCI8 for PHP 5.2 - PHP 5.6
Which I did. Next, the installer indicated what should be inserted into php.ini extension=oci8.so
That's it!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question