Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP page not rendering properly

Posted on 2011-02-23
6
Medium Priority
?
545 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 2000 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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 count occurrences of each item in an array.
Suggested Courses

610 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