I have tried exec, shell_exec, system but they didn't work for me.
<?php
shell_exec('gnome-terminal');
?>
I have tried exec, shell_exec, system but they didn't work for me.
<?php
shell_exec('gnome-terminal');
?>
It looks like you want to run binary file through php .... if it is Try this... Also make sure the binary file has 0777 permission
<?php
//Command
$cmd = './svdpp --training=/home/zubair/graphchi_v0.2.6/graphchi/smallnetflix_mm.train.txt --validation=/home/zubair/graphchi_v0.2.6/graphchi/smallnetflix_mm.validate.txt --binary_relevance_thresh=4 --sgd_gamma=1e-6 --max_iter=30 --quiet=1 --sgd_step_dec=0.9999 --sgd_lambda=1e-6 --D=3 --minival=1 --maxval=10';
//Binary Directory Path
$cwd = '/toolkits/collaborative_filtering/';
$descriptorspec = array (
0 => array (
"pipe",
"r"
),
1 => array (
"pipe",
"w"
),
2 => array (
"pipe",
"r"
)
);
$process = proc_open ( $cmd, $descriptorspec, $pipes, $cwd );
if (is_resource ( $process )) {
fclose ( $pipes [0] );
echo 'Progress Output >> ' . stream_get_contents ( $pipes [1] );
fclose ( $pipes [1] );
echo 'Error >> ' . stream_get_contents ( $pipes [2] );
fclose ( $pipes [2] );
echo 'Proce_close >> '.proc_close ( $process );
}
?>