Connecting Tech Pros Worldwide Forums | Help | Site Map

WAMP5 Problem

Member
 
Join Date: Oct 2006
Posts: 102
#1: Jan 18 '09
Hi Guys,

Just installed WAMP5 and placed my project in the WWW folder but whenever i access my project folder it shows me a blank page although my project folder got an index file .
i don't know what's wrong !!

ANy Help

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#2: Jan 18 '09

re: WAMP5 Problem


which directory is defined as the document root in the httpd.conf file? if you just open http://localhost/ you should see the standard apache "it works"-page (unless you have removed it), did that work for you?
Member
 
Join Date: Oct 2006
Posts: 102
#3: Jan 18 '09

re: WAMP5 Problem


Quote:

Originally Posted by Dormilich View Post

which directory is defined as the document root in the httpd.conf file? if you just open http://localhost/ you should see the standard apache "it works"-page (unless you have removed it), did that work for you?


When i open that page i do not see It works But i see a Lovely page for the Wamp called WAMP5 Homepage containing a list with my projects and some other stuff
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#4: Jan 18 '09

re: WAMP5 Problem


Ok, so it looks like your server is working just like it should.
What is the problem then?
Member
 
Join Date: Oct 2006
Posts: 102
#5: Jan 18 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

Ok, so it looks like your server is working just like it should.
What is the problem then?

:) the Problem is that the project is not working when i access my project directory it shows me a blank page
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#6: Jan 18 '09

re: WAMP5 Problem


Ok. How are you accessing the directory?
I am assuming you are trying to view it in a browser?

If so, using a file path, like "C:\www\mypage.php", will not work.
If you want to have the PHP page displayed as a PHP page, you need to go through the HTTP server, which means using a "http://localhost/..." path.

If you are already doing that, and you are still getting a blank page, check the source. See if you are getting the PHP code sent as plain-text. That would indicate that your HTTP server is not recognizing the .php extension as PHP code.
Member
 
Join Date: Oct 2006
Posts: 102
#7: Jan 18 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

Ok. How are you accessing the directory?
I am assuming you are trying to view it in a browser?

If so, using a file path, like "C:\www\mypage.php", will not work.
If you want to have the PHP page displayed as a PHP page, you need to go through the HTTP server, which means using a "http://localhost/..." path.

If you are already doing that, and you are still getting a blank page, check the source. See if you are getting the PHP code sent as plain-text. That would indicate that your HTTP server is not recognizing the .php extension as PHP code.

Yes im doing so http://localhost/... but still a blank page
how shall i fix that my HTTP server is not recognizing php extension
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#8: Jan 18 '09

re: WAMP5 Problem


Is the PHP code showing up in the source sent to the browser?

Try going to the web-root and create a file called "phpinfo.php", and put this code into it:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. phpinfo();
  3. ?>
Then do "http://localhost/phpinfo.php".

If that gives you a blank page, do "View source" (or whatever version of that your browser uses). If you see the code I just posted in the source, then you have a problem.

Then you would have to configure your Apache server so that it recognizes PHP. And how that would work depends on how you installed the server and which version of Apache you use.
Member
 
Join Date: Oct 2006
Posts: 102
#9: Jan 18 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

Is the PHP code showing up in the source sent to the browser?

Try going to the web-root and create a file called "phpinfo.php", and put this code into it:
Expand|Select|Wrap|Line Numbers

  1. <?php
  2. phpinfo();
  3. ?>



Then do "http://localhost/phpinfo.php".

If that gives you a blank page, do "View source" (or whatever version of that your browser uses). If you see the code I just posted in the source, then you have a problem.

Then you would have to configure your Apache server so that it recognizes PHP. And how that would work depends on how you installed the server and which version of Apache you use.

This phpinfo() function Works Great and shows me all the information regarding my PHP
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#10: Jan 18 '09

re: WAMP5 Problem


That means your server is configured correctly.

There must be a problem with the other page then.
Try enabling error reporting in that code. Just put these two lines at the top of the script:
Expand|Select|Wrap|Line Numbers
  1. error_reporting(E_ALL);
  2. ini_set('display_errors', true);
That should show you if there are any errors in that code.
Member
 
Join Date: Oct 2006
Posts: 102
#11: Jan 19 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

That means your server is configured correctly.

There must be a problem with the other page then.
Try enabling error reporting in that code. Just put these two lines at the top of the script:
Expand|Select|Wrap|Line Numbers

  1. error_reporting(E_ALL);
  2. ini_set('display_errors', true);



That should show you if there are any errors in that code.


i enabled error reporting but still shows me a blank page !
i have an index.php script in the project ..can this be the problem ? maybe its conflicting with the index.php of the WAMP
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#12: Jan 19 '09

re: WAMP5 Problem


Quote:

Originally Posted by jessy View Post

i have an index.php script in the project ..can this be the problem ? maybe its conflicting with the index.php of the WAMP

I don't think so. does your project reside directly in the document root folder or has it a (sub)folder of its own?
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#13: Jan 19 '09

re: WAMP5 Problem


Yea, Dormilich is right. If there was a conflict, you would be seeing the other index file, not a blank page.

What is the exact URL you are using, and where exactly is this index file you want displayed?

Assuming you are using the correct URL, and that the files are in the correct place, then I guess the problem would have to be with your PHP code.
Could we see that?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#14: Jan 19 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

... then I guess the problem would have to be with your PHP code.

I had this problem once, when my PHP installation had a broken library.... but that's rather rare.
Member
 
Join Date: Oct 2006
Posts: 102
#15: Jan 19 '09

re: WAMP5 Problem


Quote:

Originally Posted by Atli View Post

Yea, Dormilich is right. If there was a conflict, you would be seeing the other index file, not a blank page.

What is the exact URL you are using, and where exactly is this index file you want displayed?

Assuming you are using the correct URL, and that the files are in the correct place, then I guess the problem would have to be with your PHP code.
Could we see that?

D:\wamp\www\Project_1\company this is the path of my project and the index file is in the company folder
and this is the index file as well :
Expand|Select|Wrap|Line Numbers
  1. <?  include("companyval.php");
  2.     include("../include/conf.php"); ?>
  3. <?include("1header.php");?>
  4. <?include("1footer.php");?>
its just some included files
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#16: Jan 19 '09

re: WAMP5 Problem


do you have short tags enabled (see phpinfo())? generally, it is best to use the full tag (<?php).

further,
Expand|Select|Wrap|Line Numbers
  1. <?include('file.php');?>
is invalid ("<?include" is not a valid processing instruction), better use
Expand|Select|Wrap|Line Numbers
  1. <?php include 'file.php'; ?>
Member
 
Join Date: Oct 2006
Posts: 102
#17: Jan 19 '09

re: WAMP5 Problem


Quote:

Originally Posted by Dormilich View Post

do you have short tags enabled (see phpinfo())? generally, it is best to use the full tag (<?php).

further,

Expand|Select|Wrap|Line Numbers
  1. <?include('file.php');?>
is invalid ("<?include" is not a valid processing instruction), better use
Expand|Select|Wrap|Line Numbers
  1. <?php include 'file.php'; ?>

GOD BLESS YOU !

Thanks alot
R u married :)
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#18: Jan 19 '09

re: WAMP5 Problem


yea..... small cause, big trouble (if it were always that simple)
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#19: Jan 19 '09

re: WAMP5 Problem


So it all boils down to a syntax error. Those things will be the death of us all :]

Still, you should have seen the code in the source of your page. Didn't you check that a few posts back?

In any case, glad it all worked out.
Reply