Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run phonegap using php?

how to run phonegap cli using php scripts?
i can manually run phonegap with windows cmd and everything works great but when i call ex:'phonegap build android' in php exec, nothing happens. no error no catch block, nothing.

here is my code:

test.php

<?php
$out = array();
try {
    $create_command = 'phonegap create test';
    $build_command = 'phonegap build android';
    exec($build_command,$out);
    foreach($out as $line) echo $line.'<br>';
}
catch(Exception $ex) {
    echo $ex->getMessage();
}
?>

by the way i registered php in environments then ran 'php %path_to_file%/test.php' in cmd and it worked.

like image 207
moni as Avatar asked Dec 16 '25 15:12

moni as


1 Answers

thanks for your replies. but there was nothing wrong with my codes. problem was fast-cgi which is not installed by default on xampp. i changed my web server to nginx using this web server WT-NMP.

like image 122
moni as Avatar answered Dec 19 '25 06:12

moni as



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!