Last active
          June 14, 2024 11:01 
        
      - 
      
- 
        Save syahzul/8f29a34a45c62fc577f7964ba123d4ba to your computer and use it in GitHub Desktop. 
Revisions
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -130,5 +130,6 @@ Test it on your web browser. ## References - [https://runcloud.io/docs/guide/cheat-sheet/php#installing-custom-php-modules](https://runcloud.io/docs/guide/cheat-sheet/php#installing-custom-php-modules) - [https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e](https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e) - [https://www.php.net/manual/en/oci8.installation.php](https://www.php.net/manual/en/oci8.installation.php) 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -131,5 +131,4 @@ Test it on your web browser. ## References - [https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e](https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e) - [https://www.php.net/manual/en/oci8.installation.php](https://www.php.net/manual/en/oci8.installation.php) 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -127,3 +127,9 @@ else { ``` Test it on your web browser. ## References - [https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e](https://gist.github.com/Yukibashiri/cebaeaccbe531665a5704b1b34a3498e) - [https://www.php.net/manual/en/oci8.installation.php](https://www.php.net/manual/en/oci8.installation.php) 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ This tutorial only tested with Ubuntu Server 20.04 configured by [RunCloud](http Visit [Oracle Instant Client website](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) and download the following files: - instantclient-basic-linux.x64-19.9.0.0.0dbru.zip - instantclient-sdk-linux.x64-19.9.0.0.0dbru.zip ## Step 2 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,7 @@ This tutorial only tested with Ubuntu Server 20.04 configured by [RunCloud](http ## Step 1 Visit [Oracle Instant Client website](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) and download the following files: - instantclient-basic-linux.x64-19.9.0.0.0dbru.zip - instantclient-sdk-linux.x64-19.9.0.0.0dbru.zip. 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ # How To Install OCI8 on RunCloud Ubuntu 20.04 This tutorial only tested with Ubuntu Server 20.04 configured by [RunCloud](https://runcloud.io/r/Prkd5Ly7e6wV). ## Step 1 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,15 +66,15 @@ cd oci8-2.2.0 ## Step 5 We need ```autoconf``` installed before we can proceed. ``` apt install autoconf ``` ## Step 6 Install using ```phpize``` provided by RunCloud. ``` make clean 
- 
        syahzul revised this gist Dec 1, 2020 . 1 changed file with 7 additions and 11 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ ln -s /opt/oracle/instantclient_19_9/libclntsh.so.19.1 /opt/oracle/instantclient ln -s /opt/oracle/instantclient_19_9/libocci.so.19.1 /opt/oracle/instantclient_19_9/libocci.so ``` ## Step 3 Add the folder to our ```ldconfig```. @@ -45,38 +45,34 @@ sudo -s echo /opt/oracle/instantclient_19_9 > /etc/ld.so.conf.d/oracle-instantclient.conf ``` Run the command below to update the Dynamic Linker Run-Time Bindings ``` ldconfig ``` ## Step 4 Download oci8-2.2.0.tgz from official PHP website. Make sure not to download oci8-3.0.0.tgz since it's for PHP8. [https://pecl.php.net/get/oci8-2.2.0.tgz](https://pecl.php.net/get/oci8-2.2.0.tgz) Extract the downloaded file. ``` tar -zxf oci8-2.2.0.tgz cd oci8-2.2.0 ``` ## Step 5 We need autoconf installed before we can proceed. ``` apt install autoconf ``` ## Step 6 Install using PHPIZE @@ -92,7 +88,7 @@ make clean make install ``` ## Step 7 Next, we need to create ini files for PHP. @@ -110,7 +106,7 @@ systemctl restart php73rc-fpm.service systemctl restart php72rc-fpm.service ``` ## Test From your Terminal, check if the module is loaded: 
- 
        syahzul renamed this gist Dec 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # How To Install OCI8 on RunCloud Ubuntu 20.04 ## Step 1 
- 
        syahzul created this gist Dec 1, 2020 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,136 @@ # Install PHP OCI8 on RunCloud Ubuntu 20.04 ## Step 1 Download the Oracle Instant Client and SDK from Oracle website. [https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) Files: - instantclient-basic-linux.x64-19.9.0.0.0dbru.zip - instantclient-sdk-linux.x64-19.9.0.0.0dbru.zip. ## Step 2 Create a new folder to store Oracle Instant Client zip files on your server. ``` sudo mkdir /opt/oracle ``` Upload the downloaded files to this folder. Now we need to extract the files. ``` cd /opt/oracle unzip instantclient-basic-linux.x64-19.9.0.1.0.zip unzip instantclient-sdk-linux.x64-19.9.0.1.0.zip ``` Next, we need to create a symlink to Instant Client files. ``` ln -s /opt/oracle/instantclient_19_9/libclntsh.so.19.1 /opt/oracle/instantclient_19_9/libclntsh.so ln -s /opt/oracle/instantclient_19_9/libocci.so.19.1 /opt/oracle/instantclient_19_9/libocci.so ``` ## Step 4 Add the folder to our ```ldconfig```. ``` sudo -s echo /opt/oracle/instantclient_19_9 > /etc/ld.so.conf.d/oracle-instantclient.conf ``` Run the command below to update the Dynamic Linker Run-Time Bindings ``` ldconfig ``` ## Step 5 Download oci8-2.2.0.tgz from official PHP website. Make sure not to download oci8-3.0.0.tgz since it's for PHP8. [https://pecl.php.net/get/oci8-2.2.0.tgz](https://pecl.php.net/get/oci8-2.2.0.tgz) ## Step 6 Extract the file. ``` tar -zxf oci8-2.2.0.tgz cd oci8-2.2.0 ``` ## Step 7 We need autoconf installed before we can proceed. ``` apt install autoconf ``` ## Step 8 Install using PHPIZE ``` make clean /RunCloud/Packages/php74rc/bin/phpize --clean /RunCloud/Packages/php74rc/bin/phpize ./configure --with-oci8=shared,instantclient,/opt/oracle/instantclient_19_9 --with-php-config=/RunCloud/Packages/php74rc/bin/php-config make install ``` ## Step 9 Next, we need to create ini files for PHP. ``` echo "extension = oci8.so" >> /etc/php72rc/conf.d/oci8.ini echo "extension = oci8.so" >> /etc/php73rc/conf.d/oci8.ini echo "extension = oci8.so" >> /etc/php74rc/conf.d/oci8.ini ``` Don't forget to restart PHP-FPM. ``` systemctl restart php74rc-fpm.service systemctl restart php73rc-fpm.service systemctl restart php72rc-fpm.service ``` ## Test OCI8 From your Terminal, check if the module is loaded: ``` php -i | grep 'oci8' ``` If returns ```oci8```, its works! Or, create a PHP file and add the code below: ``` <?php if (function_exists('oci_connect')) { echo 'OCI8 is working!'; } else { echo 'Whoopss...not working!'; } ``` Test it on your web browser.