OCI8 Problems

Problems with the Linux version of XAMPP, questions, comments, and anything related.

OCI8 Problems

Postby ralplpcr » 17. October 2019 18:06

Hi all,

I've been banging my head for over a week trying to get OCI8 to activate on my Linux system. It was so nice & easy with the PHP 5.x series - just run sudo /opt/lampp/lampp oci8, point to the library, and it was done! However, since installing XAMPP 7.3.9, I simply haven't been able to get it working.

I am running Linux Mint 19.2 XFCE edition, and I've tried to get OCI working on XAMPP 7.1.1, 7.3.9, and 7.3.10. I've even completely reformatted & installed fresh to make sure that it isn't something in my particular configuration that's blocking the installation. It just doesn't work as configured in the installer package. It says that it "likely succeeded"... but it fails to load or show in phpinfo, and attempts to run a script using OCI fail when executing unknown command ociconnect.

I've searched online, and have found several guides to install OCI8 manually, but they all relate to a different pre-configured LAMP stack or a CLI-only interface. Nothing to help me troubleshoot or install OCI8 manually into XAMPP.

Can anyone here help provide some directions how I can activate/connect to the OCI8 service in XAMPP? This would be connecting to an external Oracle server. Appreciate any help you can provide - - thanks!
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux

Re: OCI8 Problems

Postby ralplpcr » 19. October 2019 20:21

Just for kicks & giggles, I downloaded & installed Deepin Linux 15.11 today on a blank SSD. I then attempted to install XAMPP 7.3.10 from a fresh download. I had the same results. :( Following the instructions from https://www.apachefriends.org/faq_linux.html, I saw exactly what was shown in the FAQ:
Code: Select all
How do I activate the OCI8/Oracle extension for PHP?

    To activate the OCI8/Oracle extension for PHP please execute the following command:

    sudo /opt/lampp/lampp oci8

    The following dialog will start:

    Please enter the path to your Oracle or Instant Client installation:

              [/opt/lampp/lib/instantclient-11.2.0.3.0]

              installing symlinks...

              patching php.ini...

              OCI8 add-on activation likely successful.

              LAMPP: Stopping Apache with SSL...

              LAMPP: Starting Apache with SSL...

    The extension should now be active.


However, the extension was not active. Can anyone help? If I knew where XAMPP gets it's LIBRARY_PATH, LD_LIBRARY_PATH, and ORACLE_HOME environment variables, I may be able to manually point it to the correct instantclient. (I already know how to download the oci8.so using PECL)
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux

Re: OCI8 Problems

Postby ralplpcr » 26. October 2019 14:32

Wow, I must have picked a rather difficult subject! Just to follow up - I haven't had a lot of time this past week to mess with this, as I've had another project I needed to focus on. I'm not giving up, though.... still am hoping to figure out how to get OCI8 working on my Linux Mint 19.2 XFCE box. I'll keep checking in with the hope that someone can provide some guidance?
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux

Re: OCI8 Problems

Postby Nobbie » 26. October 2019 17:25

ralplpcr wrote:Wow, I must have picked a rather difficult subject!


Yes of course. Because this forum is (by far) used by private people, running their PCs and their free software packages.

Oracle8 is a professional tool for professional companies, but this forum is not meant for professional companies. It is meant for all these private guys running their private PC. We cannot support companies here. I dont know even one guy who bought an Oracle license. Xampp users are going for MySQL/MariaDB. And not Oracle. Why should a Xampp user go for Oracle?

On the other hand, professional companies usually do NOT run Xampp, which is designed for home work and home development. Its a very very rare combination, running Xampp with Oracle8.

So, yes, its "Wow", there is nobody with any Oracle knowledge, neither any knowledge about running Oracle with Xampp. Sorry for that.
Nobbie
 
Posts: 11202
Joined: 09. March 2008 13:04

Re: OCI8 Problems

Postby Altrea » 26. October 2019 17:32

Well, I have running nearly a dozen of Oracle installations at my company. I even have coupled one or two of them with PHP years ago. So I maybe have some beginner DBA skills.

But none of them is or was running on Linux and the majority of them are driven by C++ or C# applications.
I cannot help at this topic in any way.

P.S. Oracle also releases a free express version of his database product, but I have no experience with that at all
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9849
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: OCI8 Problems

Postby ralplpcr » 26. October 2019 17:58

Nobbie wrote:...Xampp users are going for MySQL/MariaDB. And not Oracle. Why should a Xampp user go for Oracle?


I develop web tools & applications for my company, which utilizes an Oracle database in production. In order to properly develop & test these tools, I need to be able to connect into this Oracle database from my test system. Xampp provides a quick & easy means of installing a functional LAMP stack with limited fuss and (at least with the PHP 5.x series & below) connect to Oracle as needed.

I don't have Oracle on my own system. I don't even have write access to Oracle at my company - - when I need to write/manipulate data with a database, I use Maria or MySQL. But having the ability to READ Oracle databases is important for me. I'll keep digging into it.... I'm sure it's possible: just need to figure out how Xampp populates all it's environment variables, and point it at the right library!

Thanks for your reply!

Altrea wrote:P.S. Oracle also releases a free express version of his database product, but I have no experience with that at all
I would be perfectly OK using an alternate means of connecting, as long as I could extract the results into a PHP script somehow. I'll take a look at the Oracle website & see if there's anything that jumps out. I've already got their "instantClient" installed.... but getting Xampp to recognize it has been a challenge.

Thanks for your response!
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux

Re: OCI8 Problems

Postby ralplpcr » 31. October 2019 19:20

No luck yet. :( I've tried installing on a fresh Ubuntu VM, a Mint 19.2 Cinnamon VM, and a fresh Fedora 31 VM. Ubuntu & Mint both gave me the same results as before. Fedora wouldn't even install XAMPP - - I kept getting a "Floating Point Error" after trying to run the XAMPP installer? [To be fair, I don't normally use .RPM-based Linux..... so that could be my fault somehow?]

Still digging.....
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux

Re: OCI8 Problems

Postby ralplpcr » 11. November 2019 19:31

I have some partial success getting OCI8 working with PHP7....unforutnately, it is only working via the CLI and not the web interface, however.

I utilized the instructions found @ https://serverfault.com/questions/911475/howto-install-oracle-oci8-instantclient-on-ubuntu-18-04 as a base. I had to modify them in several places in order to better match the XAMPP paths & variables, but at least it's progress?

I started with a brand-new VM freshly installed with Linux Mint XFCE 19.2. Installed all the updates, & then downloaded XAMPP 7.3.11 for Linux. I installed it using the default settings, except I did uncheck the box to learn more about Bitnami. When it was finished, I started the Apache service and verified that it functioned.

  • At instruction 7a, I had to manually create the oracle-instantclient.conf file, as it did not exist.
  • At instruction 8a, it appears that the method to install using pecl has been altered. I needed to run
    Code: Select all
    sudo pecl channel-update pecl.php.net
    and allow the update to complete before I could run
    Code: Select all
    sudo pecl install oci8

    as described.
  • Instruction 9b: this directory & file doesn't exist. Instead, updated /opt/lampp/etc/php.ini to add the "oci8.so" extension.
  • Since the pecl install placed the oci8.so file into /usr/lib/php/20170718, but it didn't exist in the XAMPP PHP extension directory, copy oci8.so into /opt/lampp/lib/php/extensions/no-debug-non-ztf-20180731 and make readable to all
  • Instruction 10b: this directory & file doesn't exist. Instead, update /opt/lampp/bin/envvars to add export LD_LIBRARY_PATH="/opt/oracle/instantclient" & "export ORACLE_HOME="/opt/oracle/instantclient" at the bottom of the file.

Restart the server using "sudo /opt/lampp/lampp restart"

Using the simple "php connection example" as listed (renamed to 'test.php'), I am now able to connect to the Oracle database via the CLI:
Code: Select all
php '/opt/lampp/htdocs/test/test.php'
Oracle database connection online


However, attempting to do the same via XAMPP through a web browser still fails:
Code: Select all
Fatal Error: Uncaught Error: Call to undefined function oci_connect() in /opt/lampp/htdocs/test/test.php:5 Stack trace: #0 {main} thrown in /opt/lampp/htdocs/test/test.php on line 5


Effectively, this gets OCI8 working on a separate CLI instance of PHP & Apache. It's a step in the right direction, but I'm still digging to figure out why it won't work in the web interface of XAMPP..... any idea what I'm missing?
ralplpcr
 
Posts: 6
Joined: 17. October 2019 17:54
XAMPP version: 7.3.9
Operating System: Linux


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests