简体   繁体   中英

PHP mail error … failed to open stream : permission denied

I am trying to send email using PHP mail. I get the following error:

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/home/webtest/help/ask_us.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

The PHP code is as follows:

<?php
  $name = $_REQUEST['name'] ;
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ; 
  $message = $_REQUEST['message'] ;

  mail( "myemail@myhost.com", "Subject header",
    $message, "From: $email" );
  header( "Location: http://www.google.com" );
?>

That message isn't a mail error. PHP cannot open the file ask_us.php. If ask_us.php is your file, check its permissions (and those of the parent folders).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM