MP4Box will run its course if I use the command lines on a ssh client but if I set it up on a php script it will not run example: exec(/usr/local/bin/MP4Box -hint /home/myusername/public_html/2.3gp); no error message is given I have tried exec, passthru, and shell_exec. My php scripts are being run as user "nobody" and im root when I run it through the ssh client. Any advice would be great!
Just what are you trying to achieve? All PHP scripts should be not root because that's the default and that's how it should be. Try: shell_exec('/usr/local/bin/MP4Box -hint /home/myusername/public_html/2.3gp'); PHP:
i am trying to setup a video hosting site that will offer support for mobile devices as well.... I have everything down the conversion goes well and everything works if i do it on a shell client but wont work if I do it through PHP. so meaning that if the site takes off I would have to do the hinting manually rather than it being done automatically when the user uploads a video.
I'm having the same exact problem and chmod +x /usr/local/bin/MP4Box didn't work. Any more suggestions?
Hi...I was just about to post here because I had the exact same problem. However, I found the answer here: http://www.redkawa.com/forums/archive/index.php/t-518.html Additional to -hint you also need to use -tmp and enter the directory of the file you are writing to. This causes all temporary data from MP4Box to be saved in that directory instead of the root directory (that it can't access). This command then worked for me: shell_exec('/usr/bin/MP4Box -tmp '.$output.' -hint '.$output.'/movie.mp4'); PHP: Hope it works for you too...
bw_ thank you so much for the reply but still it doesn't work! Also, do you have any idea on how to see what is the error that it's being displayed? I mean, I'm using error_reporting=E_ALL | E_STRICT and still it is not displaying any error. I know it is not working because the videos are not progressive. And MP4Box is working perfectly through the terminal with exactly the same instruction used in php exec()! Man this is crazy!
Well, what I tried at first was a test php-doc that simply contained echo shell_exec('/usr/bin/MP4Box -hint '.$output.'/movie.mp4'); PHP: When accessing this file over the web browser, it echoed some text and in the end said Error: I/O Error. Now that everything works it still echoes a bunch of info on the hinting process. Maybe you can gain some insight trying that...
That's the thing, if I do that there is no output on the browser. Completely blank... Although if I do for example exec("uptime"); it correctly shows the uptime. What could be the problem? I already chown the usr/local/bin to apache.
sorry for the late reply...try an additional echo before and after your line with shell_exec, are both displayed in the browser? is display_errors and all error reporting activated in your php.ini? also, the command posted by Kaizoku may not work if MP4Box is in another directory. For me it was chmod +x /usr/bin/MP4Box...
bw_ Thanks man, it is solved!! Also, the reason it was not giving any output is because it exec needs to be like this exec("program 2>&1",$output) and then print_r($output) other wise it doesn't print anything!! Thank you all very much, especially you bw_!