English 中文(简体)
PHP的分期延长期为20.4
原标题:Installing PHP’s OCI8 Extension on Ubuntu 20.4
  • 时间:2020-11-23 11:18:44
  •  标签:
  • oci8

我没有在我的系统中安装一个矿石数据库。 但我想与遥远的系统连接。 是否需要安装“社会8”扩展图书馆,还是需要安装即时客户和“社会8”扩展设施?

问题回答

I eventually got this working with Canonical-Ubuntu-22.04-Minimal-2023.10.15-0.

这些是乌本巴图22.04-Minimal案的全面指示。

首先安装了I gotache和PHP:

sudo su
apt update
apt -y install apache2
systemctl restart apache2

iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
netfilter-persistent save

apt -y install php libapache2-mod-php
php -v
systemctl restart apache2

echo  <?php
  phpinfo();
?>  > /var/www/html/info.php

接下来是rel=“nofollow noreferer”>。

mkdir /opt/oracle
cd /opt/oracle 

wget https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip
wget https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip
  
apt-get install unzip  
unzip instantclient-basiclite-linux.x64-21.12.0.0.0dbru.zip
unzip instantclient-sdk-linux.x64-21.12.0.0.0dbru.zip

sh -c "echo /opt/oracle/instantclient_21_12 > 
      /etc/ld.so.conf.d/oracle-instantclient.conf"
ldconfig

apt-get install php-pear
apt-get install -y php-dev
pecl install oci8-3.2.1

 instantclient,/opt/oracle/instantclient_21_12 

cd /usr/lib/php/20210902/

echo "extension = oci8.so" >> /etc/php/8.1/cli/php.ini
echo "extension = oci8.so" >> /etc/php/8.1/apache2/php.ini

reboot
sudo su
apt-get install nano
nano /var/www/html/test.php
<?php

if (function_exists( oci_connect )) {
    echo  OCI8 is working! ;
}
else {
    echo  Not working! ;
}

?>




相关问题
how to install oracle instant client for xampp

I have XAMPP for Windows 1.7.3 installed. I m using Zend Framework and need to use the pdo_oci8 extension. I ve enabled the extension - but now getting the error that it can t find the oci.dll file. ...

Are there OCI8 replacements for ADO MoveFirst and EOF, BOF?

I am researching the possibility of porting an application written in classic ASP with ADO record sets and an Oracle database to PHP5 and OCI8. We have lots of stored procedures and queries with bind ...

How can I connect PHP 5.1 to Oracle 7?

I have been able to query newer Oracle databases using the PHP oci8 extension with the Oracle 10.2 Instant Client. Unfortunately, the Oracle Instant Client seems to be unable to connect to an Oracle ...

OCI8 functions not found when run by apache with php5

I m trying to set up a server for a project in my databases class. I ll be writing the project in php, deploying it via apache, and connecting to a remote oracle server. I m having trouble with the ...

Return value of oci_parse

what will be the condition of if , where i want to execute some command inside if ,if there is no row returned by the query. <?php include_once( config.php ); $db = oci_new_connect(ORAUSER,...

Return a DESC package in PHP using OCI

Hi I am trying to get information on an Oracle package directly from PHP using OCI8: $sql = DESC my_package ; $stmt = oci_parse($conn, $sql); oci_execute($stmt); this returns: Warning: oci_execute(...

热门标签