I am new in php and I am trying to do a contact form.
In my contact.php file I am including Mail.php from pear mail package (I’ve copied Mail.php and its Mail folder in my root because I don’t have ssh access to install this directly).
Now in my php I put this:
<?php
if(!@file_exists('./Mail.php') ) {
echo 'can not include';
} else {
include('./Mail.php');
}
//rest of the code
?>
For some unknown reason I get this:
The website encountered an error while retrieving http://example.com/contact.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.
- example.com is replaced to hide my host
If I comment include statement the error is no longer occuring… I don’t understand WHAT I am doing wrong…I am sure that Mail.php is in the same root dir with my contact.php file.
Try visiting
Mail.phpdirectl, you may have some Apache securities enabled, which will reveal the issue.Other issues may be due to permissions/ownership, etc.
Some debug information on would help.