php exec无法使用pdfinfo

时间:2016-02-22 05:34:05

标签: php exec

$cmd = "pdfinfo"; // Linux
            exec ( "$cmd \"$uploaddir_path.$list_files_upload[$list_files_upload_count] \"", $output );

        // Iterate through lines
        //$pagecount [$list_files_upload_count]= 0;
        foreach ( $output as $op ) {
            // Extract the number
            if (preg_match ( "/Pages:\s*(\d+)/i", $op, $matches ) === 1) {
                $pagecount [$list_files_upload_count] = intval ( $matches [1] );
                break;
            }
        }

1 个答案:

答案 0 :(得分:0)

如果你在linux平板电脑上运行。

shell_exec()

exec()

的替代选择

exec()用于窗口,shell_exec()用于Linux平台。

Read More