小编ash*_*ajf的帖子

致命错误:允许的内存大小为134217728字节耗尽(试图分配32个字节)

可能重复:
PHP中允许的内存大小为33554432字节(尝试分配43148176字节)

执行代码时出现以下错误.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)
Run Code Online (Sandbox Code Playgroud)

尝试过ini_set('memory_limit', '128M');,但没有奏效.我的php.ini文件中的内存限制为128MB.请求帮助.

我正在添加代码.我是php新手,请帮助我解决这个问题.

<?php
require_once 'lib/swift_required.php';
$hostname = '{imap.abc.com:993/imap/ssl}INBOX';
$username = 'username';
$password = 'password';

$connection = imap_open($hostname,$username,$password) or die('Cannot connect to Tiriyo: ' . imap_last_error());
    ini_set('memory_limit', '256M');


function Message_Parse($id)

{

global $connection;

    if (is_resource($connection))
    {
        $result = array
        (
            'text' => null,
            'html' => null,
            'attachments' => array(),
        );


                $structure = imap_fetchstructure($connection, $id, FT_UID);
        //print_r($structure);
//array_key_exists — Checks if the …
Run Code Online (Sandbox Code Playgroud)

php

6
推荐指数
2
解决办法
11万
查看次数

错误的消息编号错误

我正在使用脚本转发电子邮件地址并收到错误的邮件编号错误.消息号被解析为函数的参数,我不知道如何获取消息号并将其作为参数插入.请帮忙.我是php的新手.该错误指出 $structure = imap_fetchstructure($connection, $id, FT_UID);$result['text'] = imap_body($connection, $id, FT_UID);零件.请帮我.

 <?php
require_once '../swift/lib/swift_required.php';
$hostname = '{imap.xyz.com:993/imap/ssl}INBOX';
$username = 'email';
$password = 'password';

/* try to connect */
$connection = imap_open($hostname,$username,$password) or die('Cannot connect to Tiriyo: ' . imap_last_error());

ini_set('memory_limit', '256M');

function Message_Parse($id)
{   
global $connection;
    if (is_resource($connection))
    {
        $result = array
        (
            'text' => null,
            'html' => null,
            'attachments' => array(),
        );  

                $structure = imap_fetchstructure($connection, $id, FT_UID);
        //print_r($structure);
//array_key_exists — Checks if the given key or index …
Run Code Online (Sandbox Code Playgroud)

php

2
推荐指数
1
解决办法
8970
查看次数

警告:array_key_exists()期望参数2为数组,给定布尔值

我有一段代码,用于检查数组中存在的给定键.但是当执行这段代码时,我收到错误"警告:array_key_exists()期望参数2是数组,给定布尔值".我是php新手,不知道导致此错误的原因.请帮我.

$structure = imap_fetchstructure($connection, $id, FT_UID);

        if (array_key_exists('parts', $structure))
        {
};
Run Code Online (Sandbox Code Playgroud)

php

0
推荐指数
1
解决办法
5万
查看次数

标签 统计

php ×3