PHP exec not working properly

I'm trying to run ffmpeg in my WAMP server with the exec command. Though I have set in the .htaccess file "php_value safe_mode off" and apache allow the override, the exec is still not working properly. if I try to execute

<? php exec("mkdir aaa"); ?>

it works, but when I do something like

exec("ffmpeg.exe -y -i D:\Documents\Video.wmv -f mp4 D:\Documents\Video.mp4 -y");

it doesn't do nothing. This works fine is prompted in the command line, but for some reason it doesn't when I try to execute it from the server. Do you have any ideas?

-------------Problems Reply------------

You need to escape backslashes in string literals:

exec("ffmpeg.exe -y -i D:\\Documents\\Video.wmv -f mp4 D:\\Documents\\Video.mp4 -y");

Category:php Views:0 Time:2011-10-18

Related post

  • PHP exec works when calling script directly, but not by jQuery ajax 2011-09-09

    I have a PHP script which calls exec(). I've been having trouble all day with some code calling the same script working and some not (exec() returns a 127 error code). I have finally worked out that the code that is not working is the code that is be

  • Why isn't my PHP exec() working when trying to call a Python function? 2012-02-20

    I am writing a web app that will use HTML to display a form. Then the user completes the form, and on submit the form is sent to PHP. In the PHP file I have it set up to call and exec() command to a Python file that will return data. But for some rea

  • Java Runtime.getRuntime() Illegal Argument Exception 2009-07-13

    I'm having some problems with getting the .getruntime.exec() to work properly. Here is the code dealing with that part: while (line != null) { String name = line; String commandFull = commandFirst + name + commandLast; String[] fullCommand = new Stri

  • Security of executing a command from php 2010-05-04

    I'm writing a web application in which i use several thirdy party commands calling them with the exec function in PHP (for example, I render Latex formulas through a command-line program). My question is: what are the security issues of executing ext

  • Questions about putenv() and setenv() 2011-05-03

    I have been thinking a little about environment variables and have a few questions/observations. putenv(char *string); This call seems fatally flawed. Because it doesn't copy the passed string you can't call it with a local and there is no guarantee

  • Why do these MSBuild Output Items seem empty, when they are not? 2011-11-08

    Strange way to put a question, anyway ... Basically this is my first real attempt with MSBuild. I managed to create a Target (RenameJs) which produces a new Output Items List named JsMinifyOutput (a renamed version of another input list). Then, in a

  • PHP Exec function doesnot run imagemagick sheel command, but running same script properly from shell. 2010-06-29

    I am running following command through EXEC PHP function. I am creating JPG from PDF file from ImageMagick Library. Command: /usr/local/bin/convert -density 500 '/home/pop/www/pdf/pdfSample.pdf' -resize 18% '/home/pop/www/images/pdfSample.jpg' I am g

  • Windows does not shutdown properly error message of windows exec unable to close and cannot start menu and programs 2012-11-11

    Original title : Windows not shutting down properly, error message of windows exec unable to close. Windows 7 system- I downloaded a free AVG thing to speed up the system and basically, the installation process seems to have stuffed us. Cannot open s

  • An action centre response suggested I upgrade my current bios settings. My CD ROM does not seem to be working properly. The auto exec function is not operating. 2013-10-25

    Bios upgrade ? --------------Solutions------------- Hi Ironduke1, · What are you referring to by mentioning "auto exec function is not operating" in your post? To upgrade BIOS (Basic Input/ Output System), I would recommend you to contact the system

  • How does one properly use the Unix exec C(++)-command? 2009-11-15

    Specifically, I need to call a version of exec that maintains the current working directory and sends standard out to the same terminal as the program calling exec. I also have a vector of string arguments I need to pass somehow, and I'm wondering ho

  • Exec Command doesnt seem to be executing properly in java 2011-03-28

    I have a java project built that I want to run from another java program. But when I call it using the exec command it does not execute immediately but waits for the current program to end. If I add a waitFor statement then the Program hangs as the m

  • IE BHO: How to properly initialize from IOleCommandTarget::Exec? 2011-03-30

    STDMETHODIMP CTestAddIn::Exec( const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdExecOpt, VARIANTARG *pvaIn, VARIANTARG *pvaOut) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); CProfileEdit dlg; dlg.DoModal(); return S_OK; } CTestAddIn is a subclass

  • Java Runtime exec() fails to escape characters properly 2011-05-11

    This might already been answered before but that was regarding unicode and I don't think this is unicode (it's in ASCII so...). When I execute this in my terminal there is no problem what so ever vboxmanage setextradata "Test Machine" "VBoxInternal/D

  • Exec task in msbuild TFS won't execute exe properly 2011-06-24

    I'm using web deploy to a remote server, through which we can only connect through a Cisco VPN client. In my TFS project file I have an EXEC task to open the client, then one to close it. <Exec Command="start $(COMSPEC) /C &quot;C:\Program Fil

  • Exec statement won't properly define names 2012-04-12

    Possible Duplicate: declaring a global dynamic variable in python >>> def f(): global cat exec 'cat'+'="meow"' return >>> f() >>> cat Traceback (most recent call last): File "<pyshell#23>", line 1, in <module> c

  • Runtime.exec() won't finish properly 2012-02-21

    I've created a WebApp that relies on external scripts to gather query request by the user (internal software). I've tested, with sucess, the WebApp off the glassfish server provided by netbeans but whenever I try and upload my App to a third party se

  • Properly scoped transactions in Stored Procs 2008-09-18

    Suppose I have a stored procedure that manages its own transaction CREATE PROCEDURE theProc AS BEGIN BEGIN TRANSACTION -- do some stuff IF @ThereIsAProblem ROLLBACK TRANSACTION ELSE COMMIT TRANSACTION END If I call this proc from an existing transact

  • How do I to properly handle spaces in PHP Shell_exec? 2008-12-18

    I'm running on win2003 server, PHP 526, via the cmd-line. I have a cmdline string: $cmd = ' "d:\Prog Files\foo.exe" -p "d:\data path\datadir" '; Trying to do this in php code $out = `$cmd`; # note use of backticks AKA shell_exec results in a failure

  • How to properly develop for the iPhone on a PowerPC Mac? 2009-02-18

    I'm doing iPhone development on a PowerPC Mac. How do I get code signing to work properly so that I can build to my iPhone? The iPhone SDK doesn't officially support PowerPC, but with some fidgeting, it can be installed. See here. I've got the SDK in

Copyright (C), All Rights Reserved.

processed in 0.124 (s). 11 q(s)