1

In my efforts to solve an OCI8 error, I've been led to believe it is the result of an improperly setup environment variable.

What I'm trying to do: Fix this apache environment headache, by adding variables to a certain file.

My actual problem is similar to this error from another StackOverflow user. To quote his answer to his problem:

Problem solved! To put variables in Apache's Environment section you just have to add them in /etc/sysconfig/apache2 file: LD_LIBRARY_PATH=/path/to/oracle/lib.

Notably, the solution called for the modification of the file apache2.

However, I found no such apache2 file on my system.

What I've done so far:

I searched over the net, but the closest I could come up with is /etc/httpd/conf/httpd.conf file. Assuming the httpd.conf is apache2, according to this thread, I should add the variable to the end of the file, and it should work.

So I added export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib at the very end of the file.

And... apache won't even start anymore.

My system:

It's a Fedora 19 server, with Oracle 11g, PHP 5.5.4, Apache 2.4.6, and PEAR 1.9.4. In addition to this, I have the OCI8 plug-in for PHP downloaded and enabled, and have downloaded MDB2 and the MDB2_Driver_oci8.

Apache starts automatically when I boot up my system, though if for some reason I need to stop, restart, or check its status, the command I use is systemctl start httpd.service, if it means anything.

Thanks. I've been pulling my hair out on this problem.

5
  • 2
    I'm not sure what an apache2 file is myself. httpd.conf is the Apache config file (for all versions of Apache). A better question is what are you trying to do? Commented Nov 21, 2013 at 4:27
  • could it be here /etc/apache2/apache2.conf. That is where mine is on ubuntu Commented Nov 21, 2013 at 4:35
  • okay, I just looked on my centos server and the same file is /etc/httpd/conf/httpd.conf Commented Nov 21, 2013 at 4:38
  • Yeah, fedora/centos/redhat use "httpd" instead of "apache2" Commented Nov 21, 2013 at 4:39
  • Sorry for the vague question. I've updated it to a hopefully more understandable format. As for httpd.conf, I did try modifying it, but it only broke apache. Commented Nov 21, 2013 at 4:52

1 Answer 1

1

A few things (hopefully an answer is somewhere inside)

First off, I wouldn't do this on Fedora. Fedora is the testbed for RedHat Enterprise/CentOS and it changes frequently. Even if this is just for your testing purposes, you'll find better support if you install CentOS 6 instead. The environment is virtually identical, but CentOS is better supported because so many people use it to run their servers.

Second, it sounds like you want to run the OCI8 connector (there's a reason I plugged CentOS 6). CentOS has many good repos like Remi. If you install CentOS 6 you can use his repository. This is important because this will save you a LOT of headaches down the road. Once you have his repo installed, you can do this

yum install php-oci8

And that should configure Apache to run your OCI8 extension. It's really that simple.

Sign up to request clarification or add additional context in comments.

11 Comments

Yes, I've considered CentOS, but I've strict orders to replicate an existing Fedora setup. And yes, I am trying to get it to connect to an Oracle database, via OCI8, though I've encountered a LOT of errors, and this question is just one small step in one giant problem. In any case, can I try that command on Fedora? However, I've previously ran yum install php and later, yum install php-devel - will there be complications?
No problems there. In fact, the command I referenced above would have done that for you. php-devel is necessary to compile your own PECL libraries. You can see all the php packages you've installed by using rpm -qa php*. Remi has a Fedora repo so try installing that repo and then run that command. What you're saying is "yum, find a repository with that package and install it".
I ran yum install php-oci8, but strangely, it says no package available.
Did you install the Remi repo first? (link in my post). i see that package listed in his repo for Fedora 19 rpms.famillecollet.com/fedora/19/remi/x86_64/repoview/…
Sorry for the late reply. Yes, I installed wget, then I typed in wget http://rpms.famillecollet.com/remi-release-19.rpm, followed by yum install remi-release-19.rpm, and finally, yum install php-oci8. I'm not sure about this, but doing a yum list installed | grep remi produced only three results - remi-release.noarch, 19-1.fc19.remi` and @/remi-release-19
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.