Welcome Guest, Not a member yet? Register   Sign In
i have this error Fatal error: Call to undefined function pcntl_fork() in /var/www/onplans/application/models/api_repor
#1

[eluser]dinisptc[/eluser]
i have this error Fatal error: Call to undefined function pcntl_fork() in /var/www/onplans/application/models/api_report_model.php on line 94

i went to php.ini disable functions

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-functions
;disable_functions pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,


i think pcntl its installed

$ php -m | grep pcntl
pcntl

and its installed

i am missing something here ?

i am going to show function where iam using fork

Code:
if ($pid = pcntl_fork())
            return;     // Parent
             ob_end_clean(); // Discard the output buffer and close

        fclose(STDIN);  // Close all of the standard
        fclose(STDOUT); // file descriptors as we
        fclose(STDERR); // are running as a daemon.

        register_shutdown_function('shutdown');

        if (posix_setsid() < 0)
            return;

        if ($pid = pcntl_fork())
            return;     // Parent

        // Now running as a daemon. This process will even survive
        // an apachectl stop.

        sleep(10);

          
           //gerar o report
           /* initial data */
           $Ddata['page_details'] = array('page_title' => 'Listar Artigos');
           $Dheader = array();
           $Dmeta = array('meta_title'=>'Bemvindo a dinispt','meta_descricao'=>'List my meetings');
           $DContent['page_details'] = array('page_title' => 'Index of onplans');
           $Dsidebar = array();
        $Dfooter = array();  
        
        //get projectid
        $projectID=$this->get_project_ID($j->projectUID);          
        $meetingID=$this->get_meeting($j->meetingUID);
        
        $projectUID=$projectID['id'];
        $meetingUID=$meetingID['idm'];

        //$Ddata['timeline']=$this->timeline_model->listar_timeline_onlyreports(0,0,$projectuid);

        $Ddata['meetproj']=$this->timeline_model->listar_project_meeting($projectUID,$meetingUID);
        $Ddata['meetpresences']=$this->timeline_model->listar_presences_contractors($meetingUID);
        //demands
        $Ddata['demands']=$this->timeline_model->listar_timeline_demands($projectUID);
          
        $this->load->library('pdf');
        $this->pdf->load_view('onplans/list_my_project_meeting',$Ddata);
        $this->pdf->render();
        // $this->pdf->stream("BEMVINDO.pdf",array("compress" => true));
        date_default_timezone_set("UTC");
        $file_name="report_".date("Y-m-d-H:i:s", time());
        $report_config = $this->config->item('report');
      
        
        $report_dir=$report_config['upload_path'].$this->projects_model->check_user_id().'/'.$projectUID.'/report/';
        
        
       // print_r($report_dir);
        if (!is_dir($report_dir))
        {
      mkdir($report_dir,0777,true);
        }
                        
        $pdfoutput = $this->pdf->output();

        $filename ="$report_dir/$file_name.pdf";
        $file_name="$file_name.pdf";
        
        
        $fp = fopen($filename, "a");
        fwrite($fp, $pdfoutput);
        fclose($fp);
    
        //gravar o filename na base de dados
        $this->report_model->add("report_".date("Y-m-d-H:i:s", time()),0,' ',$meetingUID,$file_name);

          
                    
     // $report=$this->report_model->get_by_meetingUUID($j->meetingUID);
           file_put_contents(APPPATH.'logs/HEEEEAAAAAAAAADDDDDDER_TEXT_SPECIALCHARS'.EXT, date('Y-m-d H:i:s').' -> '.print_r($j->header_text, true));
           return true;
    // $report;
        }
        else
        {
           return false;
        }


          
     }else
     {
         return false;
     }



}



Messages In This Thread
i have this error Fatal error: Call to undefined function pcntl_fork() in /var/www/onplans/application/models/api_repor - by El Forum - 06-12-2013, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB