[solved]Video fail to init - php exec issues

Laurent PRAT
Forums
Hello, I am using a Micro AWS Linux box Linux ip-172-31-8-3 3.4.68-59.97.amzn1.x86_64 #1 SMP Tue Nov 5 07:40:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux I am having trouble with the VIDEO module which logs this error and now seems to recurse but at the beginning it was failing to "Fork" within exec php instruction. -- log -- php 01/03/2014 - 15:36 Warning : fopen(/tmp/_temp_1388759766-52c6cad601f1d... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg -h ... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg -h... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin php 01/03/2014 - 15:36 Warning : fopen(/tmp/_temp_1388759765-52c6cad5eba19... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin php 01/03/2014 - 15:36 Warning : fopen(/tmp/_temp_1388759765-52c6cad5e5275... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin php 01/03/2014 - 15:36 Warning : exec(): Unable to fork [/usr/bin/ffmpeg ... admin I have checked into php.ini and the SAFE_MODE is OFF, so exec should be allowed even outside apache directories also /tmp is 777. btw, i can run the following command within a sample .php file Warning : exec(): Unable to fork [/usr/bin/ffmpeg -protocols 2>&1] dans PHPVideoToolkit->_captureExecBuffer() (ligne 532 dans /var/www/html/sites/all/modules/video/libraries/phpvideotoolkit/phpvideotoolkit.php5.php). Warning : fopen(/tmp/_temp_1388759766-52c6cad601f1d.txt): failed to open stream: No such file or directory dans PHPVideoToolkit->_captureExecBuffer() (ligne 538 dans /var/www/html/sites/all/modules/video/libraries/phpvideotoolkit/phpvideotoolkit.php5.php). see code mention by log : private function _captureExecBuffer($command) { $buffer = array(); $err = 0; exec($command . ' 2>&1', $buffer, $err); // line 532 if ($err !== 127) { if (isset($buffer[0]) === FALSE) { $tmp_file = $this->_tmp_directory . '_temp_' . uniqid(time() . '-') . '.txt'; exec($command . ' &>' . $tmp_file, $buffer, $err); if ($handle = fopen($tmp_file, 'r')) { // line 538 $buffer = array(); while (!feof($handle)) { array_push($buffer, fgets($handle, 4096)); } fclose($handle); } @unlink($tmp_file); } } I wonder if it's a memory issue or some kind of restrictions left somewhere?? Many thanks in advance Laurent.
Profile picture for user James Aparicio
James Aparicio

Hi Laurent PRAT,

Hi Laurent PRAT, Thanks for your feedback, is this error showing when you add a video and convert it, or do you have this error even if you dont convert it? Best regards
Laurent PRAT

Fails at init

Hello, The code does not let me upload the file, the Browse/Upload button is not even there. Regards,
dhzian

me the same

Hello, I've the same problem. To me the line is: exec($command . ' 2>&1', $buffer, $err); Is a problem of php.ini or a security problem and apache doesn't run the script? best
Profile picture for user James Aparicio
James Aparicio

Can you please go to admin

Can you please go to admin/config/media/file-system And select a temporary folder that you are sure you have full permissions to? Does this solve the problem? Best regards
Laurent PRAT

My temporary is /TMP, and it

My temporary is /TMP, and it is 777 I have just try to create a VIDEO, no sign of Browse/Upload button. still, there is nothing in the log, i have in the meantime try to extend the micro memory as sugested in this how to : http://www.the-tech-tutorial.com/?p=1408
Laurent PRAT

/tmp is 777

My temporary is /TMP, and it is 777 I have just try to create a VIDEO, no sign of Browse/Upload button. still, there is nothing in the log, i have in the meantime try to extend the micro memory as sugested in this how to : http://www.the-tech-tutorial.com/?p=1408
Profile picture for user James Aparicio
James Aparicio

Hi Laurent

Hi Laurent It still doesnt work? Can you please post the full log error messages without the ... in the middle? Best regards
Laurent PRAT

Log output requested

here are the log i used to have.. now i have NO log : Warning : exec(): Unable to fork [/usr/bin/ffmpeg -h &>/tmp/_temp_1388759766-52c6cad601f1d.txt] dans PHPVideoToolkit->_captureExecBuffer() (ligne 537 dans /var/www/html/sites/all/modules/video/libraries/phpvideotoolkit/phpvideotoolkit.php5.php). followed by the fopen() failer : Warning : fopen(/tmp/_temp_1388759766-52c6cad601f1d.txt): failed to open stream: No such file or directory dans PHPVideoToolkit->_captureExecBuffer() (ligne 538 dans /var/www/html/sites/all/modules/video/libraries/phpvideotoolkit/phpvideotoolkit.php5.php).
Profile picture for user James Aparicio
James Aparicio

If you go to admin/config

If you go to admin/config/media/video/transcoders, And select no transcoders, does it work?
Laurent PRAT

still no trace of upload button

Well it save a record, but there is Upload button, maybe i should try to uninstall/reinstall that module ? see log output : Type contenu Date Mardi, Janvier 7, 2014 - 15:56 Utilisateur admin Emplacement http://54.201.0.73/?q=node/add/video&og_group_ref=5 Référent http://54.201.0.73/?q=node/add/video&og_group_ref=5 Message video : Test No Transcoder 1 ajouté.
Profile picture for user James Aparicio
James Aparicio

Can you post your browser

Can you post your browser console log please while trying to add a video? Another thing, can you go to your modules folder, look into the opigno_video_app.info and tell me the version please? Best regards James Aparicio
Laurent PRAT

Console output : None

Version : cat /var/www/html/sites/all/modules/opigno_video_app/opigno_video_app.info name = Opigno Video App description = Opigno Video App core = 7.x package = Opigno Apps files[] = views/opigno_video_app_field_course_video_weight.inc files[] = views/opigno_video_app_sort_course_video_weight.inc dependencies[] = video dependencies[] = views dependencies[] = og dependencies[] = video_ui dependencies[] = videojs Browser Console Log : Empty. I can not attached screen shot for the other tab :/Elements/Resources/Network/.../Console
Profile picture for user James Aparicio
James Aparicio

So after you created the

So after you created the video without any conversion, when you go to the node, you dont see the video?
Profile picture for user James Aparicio
James Aparicio

Uninstalling modules and

Uninstalling modules and installing again fixed it.