How to execute .sh file from php

Hello friends,

I want to execute .sh from php.

My motto is to convert the css file to swf file. The flex code will give one .sh file. I want to execute this file from php. When i execute this file from terminal its working fine. But i want to write a code for that.

i have written like
<?php

shell_execute(‘sh filename.sh’);
?>
But, no response for me. the swf file is not created for me.

Thanks!

You’re assuming your cwd, check it. :slight_smile:

You can use exec, cmd etc.

Provide the absolute path name to the script.

you can use " exec " or " shell_exec " then your script will be like this…

<?php

shell_exec(‘sh filename.sh’);
?>

or

<?php
exec(‘sh filename.sh’);
?>