logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: File not found error
Author
Sundy



Joined: 10 Aug 2006
Posts: 4

PostPosted: Thu 10 Aug '06 9:18    Post subject: File not found error Reply with quote

Hi all,
I am totally new to all this so dont really have a clue what I am doing.
I have installed the apache server, php and mysql software into my home pc mainly for the purpose of learning php code. Everything seemed to go ok (with a couple of hiccups along the way as always) I made my phpinfo.php test file, placed it in the htdocs folder and that worked fine when viewed in a browser, I then made the mysqltest.php file and also placed it in the htdocs folder, however when I try to view this file I get a "file not found" error. Not sure why this is happening when the phpinfo.php file works fine.
Any ideas anyone Question Question
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 10 Aug '06 9:31    Post subject: Reply with quote

Is the 'File not found' error displayed in the browser or in a pop-up dialog box?

Post the code in the mysqltest.php - remove any sensitive information (like user name and password)
Back to top
Sundy



Joined: 10 Aug 2006
Posts: 4

PostPosted: Thu 10 Aug '06 9:38    Post subject: Reply with quote

Thanks alot, Pnllan, for that super fast reply.
The error is displayed in the browser, not a pop-up box.
The code in the mysqltest.php file is as follows:



Code:

<html>
<head> <title>MySQL Connection Test</tiltle> </head>
<body>
<h2>

<?php
  $connection = mysql_connect( "localhost", "root", "" )
   or die( "sorry - unable to connect to MySQL" ) ;
   echo( "Congratulations - you connected to MySQL" ) ;
?>

</h2>
</body> </html>


Thanks again for any help you can give me Very Happy Very Happy
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 10 Aug '06 9:57    Post subject: Reply with quote

What editor do you use to create/modify PHP files?

This might sound like an 'er duh', but check anyway. If you use Notepad, the file might have been saved as mysqltest.php.txt or mysqltest.txt. Use Windows Explorer, and navigate to where the file should be and verify that in fact it exists and is named properly.

Your Welcome and No worries! but it's early in the morning and I'm about to crash.
Back to top
Sundy



Joined: 10 Aug 2006
Posts: 4

PostPosted: Thu 10 Aug '06 10:15    Post subject: Reply with quote

Hi again,
I used notepad to make the file and it is named as a php file. Also I have just tried to place a html file in the htdocs folder to see if it is an error in the mysqltest.php file. My browser displays the "file not found" error when I try to view this html file as well, although the apache welcome screen (also a html file) displays fine.
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Thu 10 Aug '06 10:19    Post subject: Reply with quote

What version of Apache are you using? and where did you get it?

I don't think you are placing your new files in the right place.
Back to top
Sundy



Joined: 10 Aug 2006
Posts: 4

PostPosted: Thu 10 Aug '06 10:33    Post subject: Reply with quote

Very Happy Very Happy Very Happy Very Happy Very Happy
Well Pnllan, for my stupidity, you have my permission to slap me in the face with a wet fish, lol. Yep the documentroot was wrong, dont know how I missed that Rolling Eyes
Working fine now. Thanks so much for your help and your quick replies, I really appreciate it Wink
Back to top


Reply to topic   Topic: File not found error View previous topic :: View next topic
Post new topic   Forum Index -> Other Software