Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading a PHP file in Chrome displays PHP codes
    text
    copied!<p><strong>The Problem:</strong><br> Exactly as it says. My phpinfo.php file contains the following:</p> <pre><code>&lt;?php phpinfo(); ?&gt; </code></pre> <p>The file itself is located in <code>/var/www/html/info.php</code>.</p> <p><strong>What I did (prior to the problem):</strong><br> I erased all installations of PHP, oci8, and what not. I'm not sure if I did a good job - basically, I typed in <code>yum history</code> and then undid every install relating to PHP.</p> <p>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.</p> <p>Take note, before this complete wipeout, said file up there was working fine.</p> <p>To install PHP with oci8, I followed a guide <a href="http://antoine.hordez.fr/2012/09/30/howto-install-oracle-oci8-on-rhel-centos-fedora/" rel="nofollow">here</a>, with some differences, but I'll list it down, just the same.</p> <ul> <li>yum install php-pear</li> <li>yum install php-devel</li> <li>pear download pecl/oci8</li> <li>tar xvzf oci8-2.0.6.tgz</li> <li>cd oci8-2.0.6</li> <li>phpize</li> <li>./configure --with-oci8=$ORACLE_HOME</li> <li>make</li> <li>make install</li> <li>setsebool -P httpd_execmem 1</li> </ul> <p>Afterwards, I added the following at the very end of <code>/etc/php.ini</code> file:<br> [OCI8]<br> extension=oci8.so</p> <p>Then, I restarted apache via <code>service httpd restart</code>.</p> <p>And then, I encountered the problem.</p> <p><strong>The System:</strong></p> <ul> <li>Fedora 19 x86_64</li> <li>Oracle 11g</li> <li>Apache 2.4.6</li> </ul> <p><strong>What I tried:</strong><br> I thought at first it was Konqueror's problem. Fiddling with the View settings sometimes fixed it - most of the time, it did nothing.</p> <p>So I installed Google Chrome, which displayed the same thing.</p> <p>At this point I went, what the heck, I just installed php via <code>yum install php</code>. Maybe <code>php-pear</code> or <code>php-devel</code> on its own is not enough to run a php file.</p> <p>No dice. All I wanted was to start over and install PHP with oci8 from scratch.</p> <p>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 <code>&lt;?.... ?&gt;</code>, as opposed to <code>&lt;?php ..... ?&gt;</code>, but as you can see with my phpinfo example, it didn't help much.</p> <p><strong>Other Information:</strong><br> 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.</p> <blockquote> <p>AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive</p> <p>AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'</p> </blockquote> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload