Solved

PHP page not rendering properly

Posted on 2011-02-23
6
538 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What does != "" mean in programming 8 78
Split wordpress loop 35 56
PHP error function not working on AWS 10 69
Why will this INSERT statement not insert the date? 2 20
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

839 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