PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 7th, 2005, 05:34 AM
topbanana topbanana is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 3 topbanana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 28 sec
Reputation Power: 0
Cool http://localhost.test.php PROBLEM!

Help!

I have installed Apache and PHP on Windows 2000 but cannot get the test.php file to work. The file is in the root folder and when I check out http://localhost, I can see the file in the directory.

But when I try and open it, it gives me the open/save option. When I hit open, it says "access to the specified file, path is denied...etc etc".

If anyone knows why it wont simply open the file up, please let me know! - it's driving me completely loopy. I saw someone else had a similar prob in this forum but an answer wasn't posted.

Cheers

Reply With Quote
  #2  
Old November 7th, 2005, 07:59 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 14
I trust the URL in your Subject line is a mistake...
If not, you should be using: http://localhost/test.php

A couple of issues could be that your web server isn't rendering the PHP...
It also may be sending the wrong MIME type back to the browser...

Reply With Quote
  #3  
Old November 7th, 2005, 08:40 AM
topbanana topbanana is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 3 topbanana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 28 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
I trust the URL in your Subject line is a mistake...
If not, you should be using: http://localhost/test.php

A couple of issues could be that your web server isn't rendering the PHP...
It also may be sending the wrong MIME type back to the browser...


Cheers for getting back to me..

Yes the title I typed was wrong - my apols.

As far as I know, apache should be rendering the php ok - ive ensured its been configured with the below

LoadModule php4_module php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


...following set up from here..http://www.php-mysql-tutorial.com/install-apache-php-mysql.php

I am very new to this as Im sure you tell! so re:MIME etc Im not totally sure what you mean - but the browser should recognise the file type ok

Reply With Quote
  #4  
Old November 7th, 2005, 12:15 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 14
What does your test.php file look like?
judging by the tutorial, is it just phpinfo()?
[shouldn't be a problem]

If you choose "save" when you get prompted, do you basically save your PHP Source code? Not a rendered page?

Reply With Quote
  #5  
Old November 7th, 2005, 03:45 PM
topbanana topbanana is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 3 topbanana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 28 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
What does your test.php file look like?
judging by the tutorial, is it just phpinfo()?
[shouldn't be a problem]

If you choose "save" when you get prompted, do you basically save your PHP Source code? Not a rendered page?


When I go to http://localhost/test.php, it prompts me to either open or save.

When I open and when I save, it saves the file as a dreamweaver file. When I open this up, it just has what I typed in notepad (<?php phpinfo();?>) in code view.

Bizarrely, I tried the same tutorial on my home computer with XP and the same thing has happened! Even when I changed tutorials, the same open/save option box happened.

Apache is installed fine as http://localhost comes up sweet each time.

I'm completely lost! For some reason it isn't recognising php files and I'm in danger of eating my own arm off in frustration. I don't want to download a package so any ideas why it's not working would be greatly appreciated!

Reply With Quote
  #6  
Old November 8th, 2005, 04:47 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 1,030 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2966446 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 1 Week 12 h 39 m 36 sec
Reputation Power: 11
Send a message via ICQ to Itsacon
Try using the header() functionat the start of your code (before outputting anything!), like this:

PHP Code:
<?php
header
("Content-type: text/html");
/* Rest of PHP file */


Your server SHOULD send this header by itself, but I'm not an Apache user, so I'm not sure if the config you posted is correct (apache uses a module instead of a cgi executable)
__________________
This is my code. Is it not nifty?

"The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools."
---Douglas Adams


Join the Itsacon fanclub!    
Zero Tolerance: Spammers banned so far: 592

Reply With Quote
  #7  
Old March 15th, 2006, 03:39 AM
milina55 milina55 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 1 milina55 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
I trust the URL in your Subject line is a mistake...
If not, you should be using: http://localhost/test.php

A couple of issues could be that your web server isn't rendering the PHP...
It also may be sending the wrong MIME type back to the browser...
Comments on this post
MadCowDzz agrees: ?

Reply With Quote
  #8  
Old July 22nd, 2006, 06:41 PM
fjnlsa11 fjnlsa11 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 1 fjnlsa11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 21 sec
Reputation Power: 0
http://localhost.test.php PROBLEM!

Create test.php file :

<?php
echo 'PHP is working.<br>';
echo phpinfo();
?>
Save this file in your doc root (C:\Program Files\Apache Group\Apache2\htdocs).

Open your web browser and navigate to URL you should see the line 'PHP is working' and a whole load of info about the current PHP configuration.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > http://localhost.test.php PROBLEM!


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap