mail() 함수를 호출 할 때이 오류가 발생합니다.PHP 치명적 오류 : 메모리 크기가 33554432 바이트로 소모되었습니다 (41007872 바이트를 할당하려고 시도)
내 index.php 파일에 ini_set('memory_limit', '64m')
을 추가하려고 시도했습니다. - 다른 모든 파일을 include()하지만 수정하지 않았습니다.
memory_limit = 64M
에 (의 index.php가있는 경우) 루트 디렉토리에 php.ini의 파일을 추가했습니다. PDO 확장을 php.ini 파일에 추가 했으므로 이제는 모든 오류가 사라졌습니다.
그러나 코드는 여전히 실패합니다. phpinfo()는 메모리 제한이 64M로 증가했지만 내 mail() 함수가 페이지 실행을 중단하고 있음을 보여줍니다.
어떻게 해결할 수 있습니까? :/
메일 기능
private static function emailPassword(SafeString $email, $password)
{
$subject = 'Registration';
$message = 'Your password is: ' . $password . "\n";
$headers = 'From: [email protected]' . "\r\n";
$headers .= 'Reply-to: [email protected]' . "\r\n";
$message = str_replace("\n.", "\n..", $message);
if (!mail($email->unsafeRaw(), $subject, $message, $headers))
{
throw new Exception('Failed');
}
}
'mail' 기능은 아마도 당신의 문제가 아닙니다. 그것은 이미 전체 배럴의 마지막 드롭일지도 모릅니다. 나머지 코드에서 문제를 찾아보십시오. – deceze
40MB 할당 시도 ... unsafeRaw() 메소드는 무엇을하고 있습니까? – Arkh