本文介绍了Laravel和oracle连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我试图配置laravel与oracle数据库,我试图使用Yajra的连接,但我得到这个错误每次我尝试运行我的应用程序。I am trying to configure laravel to work with oracle database, I am trying to use Yajra for my connection but I get this error every time I try to run my application.如果任何人可以帮助我解决这个问题,我将非常感激...If anyone can help me fix this i will be extremely grateful...推荐答案 下载 如果您使用的是Windows操作系统,则您的php不支持oci8! instantclient-basic-windows 从 here Ccreate文件夹It because your php do not support oci8!if you use Windows:Download instantclient-basic-windows from hereCcreate foldercd E:/wamp64/binmkdir oracle将下载的instantclient包移动到/ oracleMove downloaded instantclient package into /oraclemv instantclient-* E:/wamp64/bin/oracleunzip instantclient-basic-windows.x64-12.1.0.2.0.zip将 instantclient_xx 添加到您的路径和编辑 php.ini取消注释extension=php_oci8_12c.dllextension=php_odbc.dll重新启动您的wamp,您将看到 oci8restart your wamp you'll see the oci8<? phpinfo(). 如果您使用 Linux : 从 instantclient-basic-linux 和 instantclient-sdk-linux http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html?ssSourceSiteId=ocomenrel =nofollow noreferrer>此处,并将其解压缩到dir中。if you use Linux:Download instantclient-basic-linux and instantclient-sdk-linux from here, and unzip it in a dir.mkdir /opt/oraclemv instantclient-* /opt/oracleunzip instantclient-basic-linux-x86-64-11.2.0.2.0unzip instantclient-sdk-linux-x86-64-11.2.0.2.0mv instantclient_11_2 instantclientcd /optchown -R root:www-data /opt/oracleecho /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclientldconfigcd /opt/oracle/instantclientln -s libclntsh.so.* libclntsh.soln -s libocci.so.* libocci.so输入'instantclient,/ opt / oracle / instantclient'you neet to input 'instantclient,/opt/oracle/instantclient'pecl install oci8在finish.check之后,如果你在目录中有pci8.so,例如 / usr / lib / php / 20151012after finish.check if you have pci8.so in directory like /usr/lib/php/20151012cd /etc/php/7.0/mods-available/vi oci.ini // extension=oci8.socd /etc/php/7.0/fpm/conf.d/ln -s /etc/php/7.0/mods-available/oci.ini 20-oci.ini追加路径vi /etc/environment# appendexport LD_LIBRARY_PATH="/opt/oracle/instantclient"export TNS_ADMIN="/opt/oracle/instantclient"export ORACLE_BASE="/opt/oracle/instantclient"export ORACLE_HOME=$ORACLE_BASEFinallyservice php7.0-fpm restart 这篇关于Laravel和oracle连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-15 06:49