1

The Problem:
Exactly as it says. My phpinfo.php file contains the following:

<?php phpinfo(); ?>

The file itself is located in /var/www/html/info.php.

What I did (prior to the problem):
I erased all installations of PHP, oci8, and what not. I'm not sure if I did a good job - basically, I typed in yum history and then undid every install relating to PHP.

This was so I could have a clean system (supposedly), before trying all the PHP stuff again, without resorting to a reformat - I had Oracle 11g and apache already setup there.

Take note, before this complete wipeout, said file up there was working fine.

To install PHP with oci8, I followed a guide here, with some differences, but I'll list it down, just the same.

  • yum install php-pear
  • yum install php-devel
  • pear download pecl/oci8
  • tar xvzf oci8-2.0.6.tgz
  • cd oci8-2.0.6
  • phpize
  • ./configure --with-oci8=$ORACLE_HOME
  • make
  • make install
  • setsebool -P httpd_execmem 1

Afterwards, I added the following at the very end of /etc/php.ini file:
[OCI8]
extension=oci8.so

Then, I restarted apache via service httpd restart.

And then, I encountered the problem.

The System:

  • Fedora 19 x86_64
  • Oracle 11g
  • Apache 2.4.6

What I tried:
I thought at first it was Konqueror's problem. Fiddling with the View settings sometimes fixed it - most of the time, it did nothing.

So I installed Google Chrome, which displayed the same thing.

At this point I went, what the heck, I just installed php via yum install php. Maybe php-pear or php-devel on its own is not enough to run a php file.

No dice. All I wanted was to start over and install PHP with oci8 from scratch.

It appears PHP itself has a problem, and I'm stuck. A bit of research online says something about the tags, that php can't run <?.... ?>, as opposed to <?php ..... ?>, but as you can see with my phpinfo example, it didn't help much.

Other Information:
I get this from PHP's error log. I'm not sure if it means anything, as I recall seeing something like this back before I nuked my system, but perhaps they can be of some use.

AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive

AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

They don't seem to appear in the error log at any predictable frequency - loading up any PHP file or restarting apache are the only two things I've done.

4
  • what do you get if you run php -i from command line (assuming CLI is installed and in path)? Commented Dec 4, 2013 at 7:45
  • ensure that your file extension is .php Commented Dec 4, 2013 at 7:49
  • @Anthony, I get a pretty long list of sessions, variables, environments, etc. Commented Dec 4, 2013 at 7:52
  • @alok.kumar, yes, the file extension is php. The file name is info.php Commented Dec 4, 2013 at 7:53

1 Answer 1

4

It's not the browser. Probably, you don't have php module activated in your Apache. Look at your httpd.conf, and put the following lines there:

# Load the PHP module:
LoadModule php5_module lib/httpd/modules/libphp5.so

# Tell Apache to feed all *.php files through PHP.  If you'd like to
# parse PHP embedded in files with different extensions, comment out
# these lines and see the example below.
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
Sign up to request clarification or add additional context in comments.

10 Comments

I added this to the very end of the httpd.conf file. It didn't work, even after I restarted the apache.
@zack_falcon This code is copied from my httpd.conf. Change php5_module to your dir if necessary. On my machine, they are located in /usr/lib/httpd/modules
@zack_falcon I am absolutely sure, that if you see text of php file, instead of result of it's execution, the module is not working, and the error is lurking here.
I found it in /usr/lib64/httpd/modules/libphp5.so/, and changed the line to that. When that didn't work, I changed it to lib64/httpd/modules/libphp5.so/. Unfortunately, it didn't work either.
@zack_falcon Why do you have a slash at the end? Is the path to file: /usr/lib64/httpd/modules/libphp5.so/libphp5.so?
|

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.