sorry for the bad explanation and bad grammar
➜ project-name php --version
PHP 7.4.16 (cli) (built: Mar 4 2021 12:36:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
and i was trying too with v8
➜ ~ php --version
PHP 8.0.7 (cli) (built: Jun 3 2021 19:10:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
before i was trying with 3 version of oracle instant, sdk
- v11.1
- v12.2
- v19.8.0.0.0
i was checking my oci its working by running composer require yajra/laravel-oci8:^7
where the command needed oci8.
➜ project-name pa package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: yajra/laravel-oci8
Package manifest generated successfully.
but,,,
when i check on phpinfo()
my page is going on 502 Bad Gateway nginx/1.19.8
when i check on oci_error()
the response is false
thats mean there is no error, right ?.
when i comment ;extension=oci8.so
on php.ini
and
➜ project-name brew services restart php@7.4
phpinfo()
is work but i need oci_connect
function .
already tried restart, shutdown laptop , any service like nginx, php, still not solve,
when i check my logs on nginx or valet , there is no error or log
/usr/local/var/log/nginx
/opt/nginx/logs/error.log
my step install oci8 is
unzip oracle package (instant,sdk,sqlplus)
sudo ln -s /opt/instantclient_19_8/sdk/include/*.h /usr/local/include/
sudo ln -s /opt/instantclient_19_8/sqlplus /usr/local/bin/
sudo ln -s /opt/instantclient_19_8/*.dylib /usr/local/lib/
sudo ln -s /opt/instantclient_19_8/*.dylib.19.1 /usr/local/lib/
sudo ln -s /usr/local/lib/libocci.dylib.19.1 /usr/local/lib/libocci.dylib
sudo ln -s /usr/local/lib/libclntsh.dylib.19.1 /usr/local/lib/libclntsh.dylib
sudo pecl install oci8-2.2.0
and i was try too with sudo pecl install oci8 for php8 version
my respond of oracle home instantclient,/usr/local/lib
the respond
Build process completed successfully
Installing '/opt/homebrew/Cellar/php@7.4/7.4.16/pecl/20190902/oci8.so'
install ok: channel://pecl.php.net/oci8-2.2.0
Extension oci8 enabled in php.ini
so i change
extension_dir = "/opt/homebrew/Cellar/php@7.4/7.4.16/pecl/20190902"
;extension_dir = "/opt/homebrew/lib/php/20190902"
but in php8 i don't need change the dir.
i run check oci like as what i was check on above.
➜ ~ sudo nginx -t
nginx: the configuration file /opt/homebrew/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /opt/homebrew/etc/nginx/nginx.conf test is successful
when i try check with phpinfo() condition is 502 bad gateway -> check with
<?php
if (oci_connect('xusername', 'xpassword', 'xip/XE', 'xcharset')) {
print 'right';
} else {
print 'error';
}
➜ oracle php -q b.php
dyld: lazy symbol binding failed: Symbol not found: _OCIEnvNlsCreate
Referenced from: /opt/homebrew/lib/php/pecl/20200930/oci8.so
Expected in: flat namespace
dyld: Symbol not found: _OCIEnvNlsCreate
Referenced from: /opt/homebrew/lib/php/pecl/20200930/oci8.so
Expected in: flat namespace
[1] 35993 abort php -q b.php
by reference on https://theoldape.com/mac-os-x-php-with-oracle-oci8-extension/ its mean wrong os version . hm
i have test with instantclient-basic-macos.x64-19.8.0.0.0dbru
on my device mbp m1
in https://www.oracle.com/database/technologies/instant-client/downloads.html only Instant Client for macOS (Intel x86) and Instant Client for Mac OS X (PPC)
the problem i have found , its same like on dyld: lazy symbol binding failed for php oic8 on Apple M1
i have solved my phpinfo() with instantclient-sqlplus-macosx-10.1.0.3
(Instant Client for Mac OS X (PPC))
so i can see oci8 table of configuration
then i try php -i i have solved there is no error like as on dyld: lazy symbol binding failed for php oic8 on Apple M1 (dyld: lazy symbol binding failed: Symbol not found: _OCIClientVersion) ,
but when i try
➜ oracle php -q b.php
i still get error dyld: lazy symbol binding failed: Symbol not found: _OCIEnvNlsCreate