0

exec("lame audio.mp3 audio.wav")

Similar questions didn't helped.

This is the command that should be executed via PHP.

  1. The audio.mp3 file presents in the directory and no permission issues.
  2. Lame encoder is present at: C:\Program Files (x86)\Lame. This path is added into System Environmental Variables PATH.
  3. lame command works in cmd, it displays the version as 3.99.3. (This means lame is installed and added to the PATH properly).
  4. The PHP file present in the folder D:\XAMPP\htdocs\demo.php. Executing lame audio.mp3 audio.wav via cmd in the directory D:\XAMPP\htdocs runs properly and the mp3 file is converted to wave file without any issue.

The PHP exec is alone not working. Where I am missing?

Edit: The error.log file have the following error:

'lame' is not recognized as an internal or external command, operable program or batch file.

Mr Cathode
  • 73
  • 14
  • 1
    Keep in mind that the apache process usually is executed under a different user account than what you do on command line. That means paths, environment variables and permissions typically are different. You need to perform your command line tests using the same user account as the apache server process. – arkascha Jul 25 '17 at 21:23
  • @arkascha The machine does not have any other user account. You are mentioning the windows user account, right? – Mr Cathode Jul 25 '17 at 21:28
  • As a software developer I have little experience with MS-windows based operating systems, sorry. But certainly there are system accounts used for services on those systems too, everything else would be a huge security issue. – arkascha Jul 25 '17 at 21:29

0 Answers0