adidaPHP Posted July 13, 2010 Share Posted July 13, 2010 Hi guys, I am facing problems using exec() with lame mp3 emcoder. Here's the code snippet: $edit_id = $_GET['id']; $soundsDir = "/path/to/soundsDir"; $target_path = "/psth/to/target/"; $target_path = $target_path . $edit_id . ".mp3"; $wavpath = $soundsDir . $edit_id ".wav"; exec("/usr/local/bin/lame $target_path --decode $wavpath", $command_output, $result); //...... The problem seems with using $target_path and $wavpath inside the exec statement. It works fie when I hard code the input and output file links. So is there any problem using php variables inside the double quotes? I have tried doing this way too: exec("/usr/local/bin/lame". $targetpath . "--decode" . $wavpath, $command_output, $result); But that doesn't work either :'( Quote Link to comment Share on other sites More sharing options...
Alex Posted July 13, 2010 Share Posted July 13, 2010 Echo out the variables and make sure they contain what you want (what you were hard-coding into the script to make it work). Quote Link to comment 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.