LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP script wont execute (https://www.linuxquestions.org/questions/programming-9/php-script-wont-execute-818531/)

linuxfreak3 07-07-2010 11:29 AM

PHP script wont execute
 
PHP Code:

<?
exec
("./zipalign -v 4 update.zip update4.zip");
?>

this script wont work on my server for some reason
can anyone see whats wrong with it?
i want it to run that file and its in the right folder with the right permissions.

delite 07-07-2010 01:18 PM

Try using popen to capture the result...

http://www.rawstar7.co.uk/docs/view/186

linuxfreak3 07-07-2010 02:02 PM

Thanks!
it worked :O for some reason with this the command worked
Quote:

function exe($cmd){
$aret=array();
if(!$f=popen($cmd,'r')){return null;}
while(!feof($f)){
$o=fgets($f,1024);
$aret[]=$o;
}
pclose($f);
return $aret;
}

$a=exe('./zipalign -v 4 update.zip update4.zip');
foreach($a as $e){
print $e."<br />";
}
:D
edited it to remove the output and now its fine :)


All times are GMT -5. The time now is 11:20 PM.