Jump to content

Problem with exec()


adidaPHP

Recommended Posts

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  :'(

 

Link to comment
https://forums.phpfreaks.com/topic/207642-problem-with-exec/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.