mofolo Posted January 3, 2010 Share Posted January 3, 2010 Hey Forum! I need some help with my project. I wish to create .deb files using PHP, but I can't seem to get it to work: This is what I'm doing: echo system("dpkg-deb --help",$c); echo $c; Line 1 does not return anything, and line 2 ($c) outputs "127"; Any Suggestions? Thanks. P.S: This is a good looking forum layout. Me likey! Quote Link to comment https://forums.phpfreaks.com/topic/187028-packing-a-deb-using-php5/ Share on other sites More sharing options...
Zane Posted January 3, 2010 Share Posted January 3, 2010 there are other functions to try out. exec shell_exec passthru system Quote Link to comment https://forums.phpfreaks.com/topic/187028-packing-a-deb-using-php5/#findComment-987694 Share on other sites More sharing options...
AngelG107 Posted January 15, 2010 Share Posted January 15, 2010 The reason that why you're not getting any message displayed it's because you need to redirect where the message will be outputted, by the default they're outputted to the Terminal. Simply do something like this : <?php $command = "yum -y install squid"; //this is a testing command, it will install squid in the server. exec($command); ?> Replace the value for the correct one, and i can assure it'll work. Quote Link to comment https://forums.phpfreaks.com/topic/187028-packing-a-deb-using-php5/#findComment-995678 Share on other sites More sharing options...
trq Posted January 15, 2010 Share Posted January 15, 2010 The reason that why you're not getting any message displayed it's because you need to redirect where the message will be outputted, by the default they're outputted to the Terminal. No. By default most Linux commands send there output to stdout, and this is exactly what system() returns. Quote Link to comment https://forums.phpfreaks.com/topic/187028-packing-a-deb-using-php5/#findComment-995810 Share on other sites More sharing options...
gizmola Posted January 23, 2010 Share Posted January 23, 2010 To elaborate on Thorpe's answer, you apparently are getting the return value from your dpkg-deb command. To capture the actual output of the command: $output = `dpkg-deb --help`; echo $output; Note that these have to be backtics around the command, exactly as shown. Quote Link to comment https://forums.phpfreaks.com/topic/187028-packing-a-deb-using-php5/#findComment-1000352 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.