Author |
|
Sundy
Joined: 10 Aug 2006 Posts: 4
|
Posted: Thu 10 Aug '06 9:18 Post subject: File not found error |
|
|
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 |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Thu 10 Aug '06 9:31 Post subject: |
|
|
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
|
Posted: Thu 10 Aug '06 9:38 Post subject: |
|
|
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 |
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Thu 10 Aug '06 9:57 Post subject: |
|
|
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
|
Posted: Thu 10 Aug '06 10:15 Post subject: |
|
|
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
|
Posted: Thu 10 Aug '06 10:19 Post subject: |
|
|
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
|
Posted: Thu 10 Aug '06 10:33 Post subject: |
|
|
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
Working fine now. Thanks so much for your help and your quick replies, I really appreciate it |
|
Back to top |
|