...

View Full Version : Run bash script in php



anandselvaraj
10-26-2012, 07:51 AM
Hi,

This is bash script -t "SOME PLAIN TEXT" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink. How to run in php. help me pls.

I tried this way

$response = shell_exec('-t "SOME PLAIN TEXT" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink'); //executing shell command.

echo "<pre>$response</pre>";

output is empty.

DrDOS
10-26-2012, 04:42 PM
$response = `echo -E "-t \"SOME PLAIN TEXT\" -s plain -e normal -f Arial -p 48 -c royalblue -b white -u lightpink"`; //executing shell command.

patryk
10-26-2012, 05:36 PM
actually 99% of servers would use sh as default shell and not bash.
that's for performance.

if you want to run a bash script u should create script file, chmod it so server could execute it and then call it with shell_exec()



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum