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! ;
}
?>