文本文件在我的PHP应用程序,我想创建一个错误日志中这样尝试过这样的工作的罚款在我的本地机器的文本格式PHP创建服务器
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
$stringData = "Error Info: ".$mail->ErrorInfo."\t\t";
$stringData .= "Email to reciepient \t Regnumber: ".$RegNo." \t Apllicant Name: ".$ApplicantName." Failed --- end ----";
$fp = fopen($_SERVER['DOCUMENT_ROOT']."/lib/email_errorlog.txt","wb");
fwrite($fp,$stringData);
fclose($fp);
exit;
}
我已经在PHP Create and Save a txt file to root directory看到讨论,但它不适合我。问题是,没有显示错误,但文本文件没有创建。需要在服务器上设置任何权限?
是的,问题是与文件夹权限,现在我纠正了,并正常工作..谢谢。 – Rakesh