3than Posted August 12, 2008 Share Posted August 12, 2008 I'm working with a drupal installation and the op_video module and am fairly new to PHP. I installed ffmpeg here: /usr/bin/ffmpeg but the module says it can't find it there. I suspect it's something to do with the way my server is configured, but I have both safe mode and open_basedir off. Is there some code I can insert into the module to get a verbose error message that shows what's actually happening when it tries to find ffmpeg? I want to know where it's actually looking for it, and what happens when it tries to access it. I think I've quoted the relevant code below. thanks Ethan $output = array(); _op_video_ffmpeg_exec('-version', $output, $result); if($result == 0) { $fieldset[] = _op_video_ffmpeg_version_info_fieldset($output); $output = array(); _op_video_ffmpeg_exec('-formats', $output, $result); $fieldset[] = _op_video_ffmpeg_formats_fieldset($output); $fieldset[] = _op_video_ffmpeg_codecs_fieldset($output); } else { $fieldset[] = array( '#value' => '<p><b>' . t('FFmpeg binary not found.') . '</b></p>' ); } Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/ Share on other sites More sharing options...
DarkWater Posted August 12, 2008 Share Posted August 12, 2008 Can I see this function's code? _op_video_ffmpeg_exec() Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614898 Share on other sites More sharing options...
Jabop Posted August 12, 2008 Share Posted August 12, 2008 i think i may know what your problem is. run this command for me on your box: cat /etc/ld.so.conf and tell me the output Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614916 Share on other sites More sharing options...
DarkWater Posted August 12, 2008 Share Posted August 12, 2008 i think i may know what your problem is. run this command for me on your box: cat /etc/ld.so.conf and tell me the output Oh hey, I got quoted in your sig. And have you seen this problem before? Just curious. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614928 Share on other sites More sharing options...
3than Posted August 12, 2008 Author Share Posted August 12, 2008 i think i may know what your problem is. run this command for me on your box: cat /etc/ld.so.conf and tell me the output include ld.so.conf.d/*.conf Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614932 Share on other sites More sharing options...
3than Posted August 12, 2008 Author Share Posted August 12, 2008 Can I see this function's code? _op_video_ffmpeg_exec() function _op_video_ffmpeg_exec($params, &$output, &$result, $mode = 0) { $ffmpeg = variable_get('op_video_ffmpeg_binary', OP_VIDEO_DEFAULT_FFMPEG_BINARY); $extra_params = variable_get('op_video_ffmpeg_extra_params', ''); $command = array($ffmpeg, $params, $extra_params, '2>&1'); _op_video_exec($command, $output, $result, $mode); _op_video_reset_cron(); } Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614936 Share on other sites More sharing options...
Jabop Posted August 12, 2008 Share Posted August 12, 2008 I ran into it when I was configuring ffmpeg, actually You have to add some things to your conf file for it to work, if it is the identical problem. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614939 Share on other sites More sharing options...
Jabop Posted August 12, 2008 Share Posted August 12, 2008 run: find / -name 'libavdevice.so.*' add the directories that come up with results into that conf file, then run sudo ldconfig Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614940 Share on other sites More sharing options...
3than Posted August 12, 2008 Author Share Posted August 12, 2008 run: find / -name 'libavdevice.so.*' add the directories that come up with results into that conf file, then run sudo ldconfig no results, just this: find: WARNING: Hard link count is wrong for /proc/vz/vzaquota: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-614951 Share on other sites More sharing options...
3than Posted August 13, 2008 Author Share Posted August 13, 2008 I can run ffmpeg from the command line, it's just that the module says it can't find it. Any suggestions for tracking what the module is actually doing? Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-615652 Share on other sites More sharing options...
3than Posted August 14, 2008 Author Share Posted August 14, 2008 OK here's another clue -- I set up a test.php file: <?php $ffmpeg = "/usr/bin/ffmpeg -version"; $out = @fopen('php://output', 'a') or die("Could not open STDOUT"); exec($ffmpeg); echo $out; ?> it works fine from the command line, I think: [root@vps httpdocs]# php test.php FFmpeg version SVN-rUNKNOWN, Copyright © 2000-2007 Fabrice Bellard, et al. configuration: --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip libavutil version: 49.4.0 libavcodec version: 51.40.4 libavformat version: 51.12.1 built on Jun 4 2007 11:02:12, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52) ffmpeg SVN-rUNKNOWN libavutil 3212288 libavcodec 3352580 libavformat 3345409 Resource id #5 but if I hit it via http I get only this: Resource id #3 Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-616149 Share on other sites More sharing options...
ardyandkari Posted August 14, 2008 Share Posted August 14, 2008 wouldnt this need mysql_result() or mysql_fetch_array() to output anything??? Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-616171 Share on other sites More sharing options...
3than Posted August 14, 2008 Author Share Posted August 14, 2008 wouldnt this need mysql_result() or mysql_fetch_array() to output anything??? I don't know -- I don't think there are any mysql calls required here? I'm just trying to figure out why the call to ffmpeg isn't working. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-616490 Share on other sites More sharing options...
Jabop Posted August 14, 2008 Share Posted August 14, 2008 3than, try echo passthru("ffmpeg -v"); Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-616500 Share on other sites More sharing options...
3than Posted August 14, 2008 Author Share Posted August 14, 2008 3than, try echo passthru("ffmpeg -v"); works from the command line but yields a blank page via http tried it with mysql --version instead and that worked, same result from command line and in the browser. hmmm. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-616529 Share on other sites More sharing options...
3than Posted August 15, 2008 Author Share Posted August 15, 2008 I reinstalled ffmpeg and the test pages work now. Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-617010 Share on other sites More sharing options...
3than Posted August 15, 2008 Author Share Posted August 15, 2008 However, the module still doesn't work, and if I change the test page back to <?php $ffmpeg = "/usr/bin/ffmpeg -version"; $out = @fopen('php://output', 'a') or die("Could not open STDOUT"); exec($ffmpeg); echo $out; ?> I still get "Resource id #3" and the same result if I replace ffmpeg with mysql. is there anything wrong with the test page as above? Link to comment https://forums.phpfreaks.com/topic/119362-solved-php-cant-find-external-binary-need-debugging-help/#findComment-617022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.