0

Right now I already install LAMPP stack in my centos 8. So far so good, apache, php and mariadb works well in my server.

I follow this tutorial https://medium.com/@azharnian/cara-install-oci8-php-7-di-centos7-851abbb5d15

I also install oracle instant client and it went pretty well. No problem setting all of it. I can see in my php - i and oci8.so exist in my /usr/lib64/php/modules directory .

oci8

OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.2.0
Oracle Run-time Client Library Version => 19.8.0.0.0
Oracle Compile-time Instant Client Version => 19.8

Directive => Local Value => Master Value
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

Statistics =>
Active Persistent Connections => 0
Active Connections => 0

And I already set in my php.ini

extension_dir = "/usr/lib64/php/modules"
[OCI8]
extension=oci8.so

And set LD_LIBRARY_PATH in my /etc/httpd/conf/httpd.conf

SetEnv LD_LIBRARY_PATH /home/user/instantclient_19_8

I even change the permission file oci8.so into sudo chmod 755 /usr/lib64/php/modules/oci8.so

I follow the suggestion in this link No oci8 module in phpinfo() also didn't work.

I even sudo reboot many times and enable/start the httpd. But still didn't work

What am I missing here ?

Appreciate if someone can help me. Many thanks.

Rzj Hayabusa
  • 657
  • 2
  • 11
  • 29
  • 1
    You say what you've done but not what your problem is. Also, you mention Apache but run php from command-line. What's the environment you want to use? – Álvaro González Jul 30 '20 at 15:10
  • @Alvaro Gonzalez . I use lampp environment. Current problem is oci8 not load in phpinfo() . – Rzj Hayabusa Jul 30 '20 at 20:52
  • Have you searched stack overflow? I seem to recall answering this question recently. – Christopher Jones Jul 31 '20 at 07:31
  • 1
    "C" is always a confusing answer to "A or B?" but I presume you mean Apache. When you type `php -i` in the console you aren't using the same PHP program than when you run PHP through a web server so any diagnostic information is kind of irrelevant. The equivalent of `php -i` is to create a script that contains ` – Álvaro González Aug 01 '20 at 08:12
  • @ÁlvaroGonzález Thanks for the reply. I've post the question because function oci_connect cannot run in my web environment (apache, php, mariadb) . And I've checked in my phpinfo() still missing oci8 module. It does not load in my phpinfo(); . – Rzj Hayabusa Aug 03 '20 at 08:43

1 Answers1

0

Might be that Apache is using php-fpm and you need to define ORACLE_HOME and LD_LIBRARY_PATH in /etc/php-fpm.d/www.conf and then restart the php-fpm daemon.

Chris Wesseling
  • 6,226
  • 2
  • 36
  • 72
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). You can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question once you have enough [reputation](https://stackoverflow.com/help/whats-reputation). - [From Review](/review/low-quality-posts/28908453) – Nick May 05 '21 at 19:01
  • @Nick, have you read the answer? It may start with "I'm having the same issue, but then it continues with providing an answer. Hi Graham. Welcome to StackOverflow. You may want to dial the chatter down in your answers. It's great you are answering an old question (we even have a badge for that), so no need to be apologetic about that. – Chris Wesseling May 06 '21 at 09:19