Hi All,
I know it is a silly error but I am very new to PHP (only 2 days!!!) & unable to resolve this. I have seen a lot of resolutions online for example:
1) Copying the "php5isapi.dll" file to the PHP directory & under "Program Files" as well.
2) Copying the "favicon.ico" file
etc etc
Before I could elaborate the issue, please note that I am a Windows user - Windows XP (I know its not the best of the OS's to work with!!!)
When initially I started getting the issue, I checked the "error.log" file under "C:\Program Files\Apache Software Foundation\Apache2.2\logs" & following is what I saw:
-----------------------
[sun Sep 18 14:13:25 2011] [notice] Server built: Sep 9 2011 10:26:10
[sun Sep 18 14:13:25 2011] [notice] Parent: Created child process 4420
[sun Sep 18 14:13:25 2011] [notice] Child 4420: Child process is running
[sun Sep 18 14:13:25 2011] [notice] Child 4420: Acquired the start mutex.
[sun Sep 18 14:13:25 2011] [notice] Child 4420: Starting 64 worker threads.
[sun Sep 18 14:13:25 2011] [notice] Child 4420: Starting thread to listen on port 80.
[sun Sep 18 14:14:55 2011] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[sun Sep 18 14:21:37 2011] [notice] Server built: Sep 9 2011 10:26:10
[sun Sep 18 14:21:37 2011] [notice] Parent: Created child process 7976
[sun Sep 18 14:21:37 2011] [notice] Child 7976: Child process is running
[sun Sep 18 14:21:38 2011] [notice] Child 7976: Acquired the start mutex.
[sun Sep 18 14:21:38 2011] [notice] Child 4420: Released the start mutex
[sun Sep 18 14:21:38 2011] [notice] Child 7976: Starting 64 worker threads.
[sun Sep 18 14:21:39 2011] [notice] Child 4420: All worker threads have exited.
[sun Sep 18 14:21:39 2011] [notice] Child 4420: Child process is exiting
[sun Sep 18 14:21:39 2011] [notice] Child 7976: Starting thread to listen on port 80.
[sun Sep 18 14:21:52 2011] [error] [client 127.0.0.1] File does not exist: C:/Rahul/Personal/Web Development/favicon.ico
----------------------
Then I created an icon file and named it "favicon.ico" & placed it in the following destinations:
1) C:/Rahul/Personal/Web Development/ and
2) C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/
but to no avail
But interestingly & surprisingly, the error.log file stopped giving any of the above error messages but I still get the HTTP Error.
Following is the error message that I get on the browser:
--------------------------
Server error
The website encountered an error while retrieving http://localhost/Forms/insert%20data.php. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
--------------------------
Now, just to let you know which php I am using, so, just to let you know, I just copied the html & php from http://www.w3schools.com/PHP/php_mysql_insert.asp. Following are they:
HTML:
----------------------------
<html>
<body>
<form action="insert data.php" method="post">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
-----------------------------
PHP
-----------------------------
<?php
$con = mysql_connect("localhost","root","orange");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
echo "Connection established";
mysql_select_db("my_db", $con);
$sql="INSERT INTO Persons (FirstName, LastName, Age)
VALUES
('$_POST['firstname']','$_POST['lastname']','$_POST['age']')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added with name: " $_POST[firstname] $_POST[lastname];
mysql_close($con)
?>
-------------------------
I hope someone is able to help me in this & I guess I have mentioned everything I could to explain the error!
Many thanks in advance!
Rahul