...

View Full Version : Configuration error?



SparrowHawk7
11-03-2010, 08:12 PM
I'm not sure if this is the right forum to post this in or not ...

I'm just starting to learn php. I'm using wamp server as a localhost, offline on my machine only, v2.2.11 with php 5.3.0. I have set php.ini for error_reporting = E_ALL.
The following code generates a blank screen where I would expect an error as nofile.php does not exist.


<?php
require("nofile.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

</body>
</html>

In fact, I can get no php code to run at all. In viewing the page source in firefox 3.6.12 I see the php code in italic. I have tried uninstalling wamp, deleting directories and reinstalling. Same with firefox and deleted all personal settings as well. I have spoken to everyone I know about this but nobody has a clue.

Last year I worked with php a little and had no problems so I'm thinking this must be a setting someplace because it is universal that php code is ignored. Could it be that apache isn't configured properly so it isn't returning php to the browser? Can someone point me in the right direction with this?

thanks,
Ken

shadowmaniac
11-03-2010, 08:40 PM
Make sure your file has a file extension of .php and not .htm / .html

SparrowHawk7
11-03-2010, 08:54 PM
I'm sorry .. I should have mentioned that. Yes .. all my files have the php extension.

shadowmaniac
11-03-2010, 08:58 PM
After u install wamp and go to "http://localhost/" what do you see?

SparrowHawk7
11-03-2010, 09:06 PM
It's probably easier to give a screen shot ...

shadowmaniac
11-03-2010, 09:17 PM
Seems fine. Create a "test.php" in your www folder (assuming you didn't change that in apache config) and add this line to it


<?php phpinfo(); ?>


then check if there's anything at http://localhost/test.php

SparrowHawk7
11-03-2010, 11:11 PM
Thank you Shadow ... I figured it out. When I opened the file with Firefox I got the blank screen .. but clicking on the link you offered opened the file correctly. That sparked my mind to realize it was a mistake in setting up the site in Dreamweaver so the files weren't being opened through apache.

Thanks so much!
Ken



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum