[英]Installing oci8 on Centos 8 running Apache and php-fpm
I have oracle instantclient 19.3 installed and can see that OCI8 is loaded in PHP from a terminal by running php -m.我安装了 oracle Instantclient 19.3,可以看到 OCI8 通过运行 php -m 从终端加载到 PHP 中。 I also added LD_LIBRARY_PATH and ORACLE_HOME and environment variables to /etc/php-fpm.d/www.conf.我还将 LD_LIBRARY_PATH 和 ORACLE_HOME 以及环境变量添加到 /etc/php-fpm.d/www.conf。 They show up correctly in the environment section in phpinfo.它们正确显示在 phpinfo 的环境部分中。
However, oci8 still does not show loading from apache.但是,oci8 仍然没有显示从 apache 加载。
Any suggestions on what else I can try to get this to work?关于我还可以尝试使其正常工作的任何建议?
On Linux, LD_LIBRARY_PATH
must be set before a process starts.在 Linux 上,必须在进程启动之前设置LD_LIBRARY_PATH
。
On Oracle Linux 8 / RHEL 8 I found that I needed to edit /etc/php-fpm.d/www.conf
and add:在 Oracle Linux 8 / RHEL 8 我发现我需要编辑/etc/php-fpm.d/www.conf
并添加:
env[LD_LIBRARY_PATH] = /usr/lib/oracle/21/client64/lib:$LD_LIBRARY_PATH
I had installed the Oracle Instant Client RPMs packages;我已经安装了 Oracle Instant Client RPM 软件包; change the path to suit your library location.更改路径以适合您的库位置。
I also disabled SELinux with setenforce permissive
to avoid the error ORA-12546: TNS:permission denied
.我还使用setenforce permissive
禁用了 SELinux,以避免出现错误ORA-12546: TNS:permission denied
。
When using Instant Client, you should not set ORACLE_HOME
.使用 Instant Client 时,不应设置ORACLE_HOME
。
Miracle of miracles.奇迹的奇迹。 Oracle has a specific instaclient for Linux 8. You can download it here. Oracle 有一个针对 Linux 8 的特定 instaclient。您可以在此处下载。 https://www.oracle.com/cis/database/technologies/instant-client/linux-x86-64-downloads.html https://www.oracle.com/cis/database/technologies/instant-client/linux-x86-64-downloads.ZFC35FDC70D5FC69D269883A822C7A5E3
Installing that driver took care of the problem.安装该驱动程序解决了这个问题。 Wahoo;)哇哦;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.