Install OCI8 (Oracle) in Ubuntu 20 With PHP 7.4 GitHub
Install OCI8 (Oracle) in Ubuntu 20 With PHP 7.4 GitHub
Install OCI8 (Oracle) in Ubuntu 20 With PHP 7.4 GitHub
4 · GitHub
eSkiSo / install_oci8_ubuntu20_php7.4.md
Created 2 years ago
Star
install_oci8_ubuntu20_php7.4.md
Step 1
Download files:
Step 2
Create new folders for Oracle Instant Client on server
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 1/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
Step 3
Extract files
cd /usr/lib/oracle/21.1/client64
Step 4
cd /usr/lib/oracle/21.1/client64/lib/
sudo ln -s libclntsh.so.21.1 libclntsh.so (It may already exist, conti
sudo ln -s libocci.so.21.1 libocci.so (It may already exist, continue)
Step 5
Edit/Create this file with the path to the lib (for LDCONFIG):
Step 6
Update Dynamic Linker
ldconfig
Step 7
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 2/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
Step 8
Install OCI8 from PCEL (desired version, default seems not to find it for me, i used
php7.)
During install it will require the path to Instant Client, write this:
instantclient,/usr/lib/oracle/21.1/client64/lib
Step 9
Restart Apache
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 3/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
Step 10
Add to mods-available
cd /etc/php/7.4/mods-available/
sudo nano oci.ini
extension = oci8.so
Step 11
cd /etc/php/7.4/apache2/conf.d
sudo ln -s /etc/php/7.4/mods-available/oci.ini 20-oci.ini
Restart Apache
Step 12 (Testing)
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 4/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
Credits
https://www.cjorellana.net/2020/12/como-instalar-oci8-en-ubuntu-2004-y-
php.html
Hi
Before step 5, you should add
sudo su -
because step 5 (and the following) will fail if you're not as root in shell
Hi the process work fine till step 8, when i run "sudo pecl install oci8-2.2.0" i have got this response
Notice: Trying to access array offset on value of type bool in PEAR/REST.php on line 187
PHP Notice: Trying to access array offset on value of type bool in
/usr/share/php/PEAR/REST.php on line 187 No releases available for package
"pecl.php.net/oci8" install failed
and can't find any way to go further!!
Hi the process work fine till step 8, when i run "sudo pecl install oci8-2.2.0" i have got this
response
Notice: Trying to access array offset on value of type bool in PEAR/REST.php on line
187 PHP Notice: Trying to access array offset on value of type bool in
/usr/share/php/PEAR/REST.php on line 187 No releases available for package
"pecl.php.net/oci8" install failed and can't find any way to go further!!
You on PHP7 or 8?
I'm on PHP 7.4.2, have found how to "Manually Installing OCI8 on Linux as a Shared Extension"
here , but i'd like understand the pecl problem.
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 5/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
Thanks, it worked for Kubuntu 20 with php 7.3 and Nginx (adapting some values to my scenario).
It fails for me, using kubuntu 20.04, OCI 21.6, and php7.2 (from
https://launchpad.net/~ondrej/+archive/ubuntu/php)
The error occurs on sudo pecl install oci8-2.2.0 :
...................
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -I/tmp/pear/temp/pear-build-
rootD9uBmD/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootD9uBmD/oci8-2.2.0/main -
I/tmp/pear/temp/oci8 -I/usr/include/php/20210902 -I/usr/include/php/20210902/main -
I/usr/include/php/20210902/TSRM -I/usr/include/php/20210902/Zend -
I/usr/include/php/20210902/ext -I/usr/include/php/20210902/ext/date/lib -
I/usr/lib/oracle/21.6/client64/lib/sdk/include -DHAVE_CONFIG_H -g -O2 -
DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/oci8/oci8_interface.c -MMD -MF
oci8_interface.dep -MT oci8_interface.lo -fPIC -DPIC -o .libs/oci8_interface.o
/tmp/pear/temp/oci8/oci8_interface.c: In function ‘zif_oci_fetch_all’:
/tmp/pear/temp/oci8/oci8_interface.c:1476:3: warning: implicit declaration of function
‘Z_PARAM_ZVAL_DEREF_EX’; did you mean ‘Z_PARAM_ZVAL_EX’? [-Wimplicit-function-
declaration]
1476 | Z_PARAM_ZVAL_DEREF_EX(array, 0, 1)
| ^~~~~~~~~~~~~~~~~~~~~
| Z_PARAM_ZVAL_EX
/tmp/pear/temp/oci8/oci8_interface.c:1476:37: error: expected ‘;’ before ‘_optional’
1476 | Z_PARAM_ZVAL_DEREF_EX(array, 0, 1)
| ^
| ;
make: *** [Makefile:222: oci8_interface.lo] Error 1
ERROR: `make' failed
Any idea?
Followed instruction:
https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbbw/index.html
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 6/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
https://stackoverflow.com/a/73094708/2605183
My problem was having multiple PHP versions installed, it was using the wrong php-dev version.
It fails for me, using kubuntu 20.04, OCI 21.6, and php7.2 (from
https://launchpad.net/~ondrej/+archive/ubuntu/php) The error occurs on sudo pecl install
oci8-2.2.0 :
...................
libtool: compile: cc -I. -I/tmp/pear/temp/oci8 -I/tmp/pear/temp/pear-build-
rootD9uBmD/oci8-2.2.0/include -I/tmp/pear/temp/pear-build-rootD9uBmD/oci8-
2.2.0/main -I/tmp/pear/temp/oci8 -I/usr/include/php/20210902 -
I/usr/include/php/20210902/main -I/usr/include/php/20210902/TSRM -
I/usr/include/php/20210902/Zend -I/usr/include/php/20210902/ext -
I/usr/include/php/20210902/ext/date/lib -
I/usr/lib/oracle/21.6/client64/lib/sdk/include -DHAVE_CONFIG_H -g -O2 -
DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/oci8/oci8_interface.c -MMD -MF
oci8_interface.dep -MT oci8_interface.lo -fPIC -DPIC -o .libs/oci8_interface.o
/tmp/pear/temp/oci8/oci8_interface.c: In function ‘zif_oci_fetch_all’:
/tmp/pear/temp/oci8/oci8_interface.c:1476:3: warning: implicit declaration of
function ‘Z_PARAM_ZVAL_DEREF_EX’; did you mean ‘Z_PARAM_ZVAL_EX’? [-Wimplicit-
function-declaration]
1476 | Z_PARAM_ZVAL_DEREF_EX(array, 0, 1)
| ^~~~~~~~~~~~~~~~~~~~~
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 7/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
| Z_PARAM_ZVAL_EX
/tmp/pear/temp/oci8/oci8_interface.c:1476:37: error: expected ‘;’ before
‘_optional’
1476 | Z_PARAM_ZVAL_DEREF_EX(array, 0, 1)
| ^
| ;
make: *** [Makefile:222: oci8_interface.lo] Error 1
ERROR: `make' failed
Any idea?
thanks a lot!!!!
Just in case it wasn't clear, you also need to add the oci8.so module in the fpm php.ini:
For me it only worked after that because the cli configuration files are different from the ones used
in http
any Idea ??
any Idea ??
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 8/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
yes I have changed several instant clients but still the same error
If there are several php versions in your system or you are using version 7.4 for example then try
to claim version via special flag:
sudo pecl -d php_suffix=7.4 install oci8-2.2.0
Hi.
My error:
No releases available for package "pecl.php.net/oci8"
Install failed
Good luck
G.
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 9/10
14/08/2023, 21:03 Install OCI8 (Oracle) in Ubuntu 20 with PHP 7.4 · GitHub
No, i did try update the pecl. It's not working. I did download with manuality, and it's fine.
aashestakov
https://medium.com/@diegoolipa/prueba-levantar-proyecto-php-ce5ef419ac78
I installed, all the step are the same guide. After that php not working . I can not run any php file.
Pls tell me why ?. Thanks
Thank you!!
https://gist.github.com/eSkiSo/781269c79b4dd740e90fcc059c1985ae 10/10