Pear internal server 500 error

I am getting a 500 server error using or trying to use pear mail and mime. The very last line of code below is causing the 500 error - “$message = new mime();”. Evidently, the file cannot be found yet I’m confident in the path.

[php]

<? require_once('../php/mail/mime.php'); require_once('../php/Mail.php'); $upload_folder = "res_upload/"; //Get the uploaded file information $name_of_uploaded_file = basename($_FILES['uploaded_file']['name']); //get the file extension of the file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;//size in KBs //Settings $max_allowed_file_size = 100; // size in KB //Validations if($size_of_uploaded_file > $max_allowed_file_size ) { $errors .= "\n Size of file should be less than $max_allowed_file_size KB"; } //copy the temp. uploaded file to uploads folder $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file; $tmp_path = $_FILES["uploaded_file"]["tmp_name"]; if(is_uploaded_file($tmp_path)) { if(!copy($tmp_path,$path_of_uploaded_file)) { $errors .= '\n error while copying the uploaded file'; } } $to = "[email protected]"; $message = new mime(); ?>

[/php]

The error message in the error file on the server reads:

[10-Jun-2012 19:58:43] PHP Fatal error: require_once() [function.require]: Failed opening required ‘…/php/mail/mime.php’ (include_path=’.:/usr/lib64/php:/usr/lib/php:/usr/share/pear:/home7/cbceduca/php’) in /home7/cbceduca/public_html/employee_job_submission_processor.php on line 9

I’m confident the path is correct yet I cannot open the file. I’ve set permissions to 0777 on the folder too. Any ideas where I might be going wrong would be warmly received.

[php]
require_once(’…/php/mail/mime.php’);
[/php]

What you are saying is to go back up one directory, then go into /php/mail/ and fetch mime.php yes? In that case that error is on line 9 or mime.php as it says.

Thanks. But line 9 is the line “require_once(’…/php/mail/mime.php’);” in employee_job_submission_processor.php . I agree that we go up one level and then /php/mail. I’m not sure I follow your advice, could you please tell me a little more.

The error with respect to mime.php went away when I moved that file under public_html. However, the same is not true for mail.php. Moving it to the same folder did not solve the problem.

Check filename. Mail.php is a different file from mail.php.

It actually turned out to be related to permissions. Tech Support at Bluehost reset permissions for both directory and file. I knew about directory permissions but did not think about file permissions. Anyway, that portion appears to have a happy ending. So, the path was correct all along but the permissions were not. Thanks for the help.

Sponsor our Newsletter | Privacy Policy | Terms of Service