解决方案 »

  1.   

    在发送邮件的php页面加上
    @set_time_limit(100);
    试试
      

  2.   


    @set_time_limit(100);
    @set_time_limit(0);
    ini_set('max_execution_time',100);
     三个都试过了,还是不行啊,求大神继续解救,急,谢谢
      

  3.   

    没玩过wp,就你贴出的代码而言,是超时
    你可以用file_put_contents('d:/log.log',.PHP_EOL,FILE_APPEND);来做跟踪(文件路径自己改),看执行到哪一步出的错,再具体分析
      

  4.   

    日志错误有错误,但始终不明白为什么会产生这样的错误:PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: unknown option bit(s) set at offset -1 in /var/www/new_grove/wp-includes/shortcodes.php on line 309是报 shortcodes.php中shortcode_parse_atts() 这个函数的错误 这支文件的错误/**
     * Retrieve all attributes from the shortcodes tag.
     *
     * The attributes list has the attribute name as the key and the value of the
     * attribute as the value in the key/value pair. This allows for easier
     * retrieval of the attributes, since all attributes have to be known.
     *
     * @since 2.5.0
     *
     * @param string $text
     * @return array List of attributes and their value.
     */
    function shortcode_parse_atts($text) {
    $atts = array();
    $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
    $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
    if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
    foreach ($match as $m) {
    if (!empty($m[1]))
    $atts[strtolower($m[1])] = stripcslashes($m[2]);
    elseif (!empty($m[3]))
    $atts[strtolower($m[3])] = stripcslashes($m[4]);
    elseif (!empty($m[5]))
    $atts[strtolower($m[5])] = stripcslashes($m[6]);
    elseif (isset($m[7]) and strlen($m[7]))
    $atts[] = stripcslashes($m[7]);
    elseif (isset($m[8]))
    $atts[] = stripcslashes($m[8]);
    }
    } else {
    $atts = ltrim($text);
    }
    return $atts;
    }
      

  5.   

    日志错误有错误,但始终不明白为什么会产生这样的错误:PHP Warning:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Compilation failed: unknown option bit(s) set at offset -1 in /var/www/new_grove/wp-includes/shortcodes.php on line 309是报 shortcodes.php中shortcode_parse_atts() 这个函数的错误 这支文件的错误/**
     * Retrieve all attributes from the shortcodes tag.
     *
     * The attributes list has the attribute name as the key and the value of the
     * attribute as the value in the key/value pair. This allows for easier
     * retrieval of the attributes, since all attributes have to be known.
     *
     * @since 2.5.0
     *
     * @param string $text
     * @return array List of attributes and their value.
     */
    function shortcode_parse_atts($text) {
    $atts = array();
    $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
    $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
    if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
    foreach ($match as $m) {
    if (!empty($m[1]))
    $atts[strtolower($m[1])] = stripcslashes($m[2]);
    elseif (!empty($m[3]))
    $atts[strtolower($m[3])] = stripcslashes($m[4]);
    elseif (!empty($m[5]))
    $atts[strtolower($m[5])] = stripcslashes($m[6]);
    elseif (isset($m[7]) and strlen($m[7]))
    $atts[] = stripcslashes($m[7]);
    elseif (isset($m[8]))
    $atts[] = stripcslashes($m[8]);
    }
    } else {
    $atts = ltrim($text);
    }
    return $atts;
    }
    309行就是
    $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
    这一句产生的错误
      

  6.   

    找到解决办法了,感觉不是最佳的解决方案,先这样,以后有更好的办法再补充
    因为使用的是admin_ajax 提交方式,所以,只能先发完一封,等ajax回调函数接受到第一封邮件发送成功的状态为之后,再进行第二封邮件的发送,不过有一点,就是第一封邮件发送完后,需要发送一些信息到前端页面,然后第二次使用ajax时,再把第一次接收到的信息,传给后台jQuery(this).submit(function(){
        //code input-data-info
        var data1 = {
             action: //第一封邮件发送函数
             //...
        };
        jQuery.post(MyAjax.ajaxurl, data1, function(fir-data){
            if(fir-data.success == 1){
                var data2 = {
                    action: 第二封邮件发送函数
                    //eg:
                    email2: fir-data.emial2
                    //...
                };
                jQuery.post(MyAjax.ajaxurl, data2, function(sec-data){
                     if(sec-data.success == 1){
                         alert("都OK");
                     }else{
                         alert("第一封OK第二封Fail"); 
                     }
                });
            }else{
               alert("第一封Fail"); 
           }
        });
    })