Solved

PHP page not rendering properly

Posted on 2011-02-23
6
533 Views
Last Modified: 2012-05-11
I have a php page that is not rendering properly. Just trying to test database connection and the page just shows the code as an output.

all it does is shows all the php code. I have enclosed the code input/output.

I tried to find out what's on the server but info() function didn't run either.
Both code behind and output is the following:
=============================================
<html>
<title>db test</title>
<?php 
$link  = oci_connect('test', 'test', 'myOracleServer'); 
if (!$link) { 
die('Could not connect to Oracle: ' . oci_error()); 
} 
echo 'Connection OK'; oci_close($link); 

?>
<body>

<?php
echo info();
</body>
?>
</html>

Open in new window

0
Comment
Question by:awarraic
  • 3
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 500 total points
ID: 34964637
Do you have a separate installations of Apache and PHP ? Or you use XAMPP, WAMP etc. ?
Seems like Apache couldn't find your php engine.
0
 

Author Comment

by:awarraic
ID: 34964700
Have separate installation of apache and PHP or that's what my network admin told me.
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34964741
Read this for a proper configuration of apache with php installed.
Or you could just install XAMPP to do it for you, there shouldn't be any problems with getting php to work.
http://www.apachefriends.org/en/xampp.html

If you would decide to run xampp, uninstall apache and php prior to that.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 34964758
0
 
LVL 14

Expert Comment

by:dejaanbu
ID: 34967841
your http://localhost/ - displays anything?

are you using WAMP or IIS?

try to display

<?php
phpinfo();
?>

0
 

Author Closing Comment

by:awarraic
ID: 34979267
PHP was not installed on apache... ODD
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now