[英]FFMpeg with PHP-7.0 on Ubuntu
I have a NGINX server with PHP-7.0 and I would like to install the ffmpeg-php extension.我有一个带有 PHP-7.0 的 NGINX 服务器,我想安装 ffmpeg-php 扩展。 I've been trying for a few days now and in many ways.
我已经尝试了几天,并以多种方式进行了尝试。
The method that worked so far was compiling ffmpeg ( https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2 ) manually, but when trying to compile ffmpeg-php (https: // sourceforge. net / projects / ffmpeg-php / files / ffmpeg-php / 0.6.0 / ffmpeg-php-0.6.0.tbz2 / download) I am encountering the following error message:到目前为止有效的方法是手动编译 ffmpeg ( https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2 ),但是在尝试编译 ffmpeg-php ( https://sourceforge.net/projects ) 时/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/下载)我遇到以下错误信息:
root@zumbiserver-mercury:~/php7-ffmpeg# make /bin/bash
root@zumbiserver-mercury:~/php7-ffmpeg# make /bin/bash
/root/php7-ffmpeg/libtool --mode=compile cc -I.
/root/php7-ffmpeg/libtool --mode=compile cc -I. -I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg/ffmpeg-php.c -o ffmpeg-php.lo libtool: compile: cc -I.
-I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I /usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr /include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/ local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg /ffmpeg-php.c -o ffmpeg-php.lo libtool: compile: cc -I. -I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:104:0, from /usr/include/php/20151012/Zend/zend_stream.h:28, from /usr/include/php/20151012/Zend/zend.h:41, from /usr/include/php/20151012/main/php.h:36, from /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/x86_64-linux-gnu/bits/stat.h:91:21: error: field 'st_atim' has incomplete type struct timespec st_atim;
-I/root/php7-ffmpeg -DPHP_ATOM_INC -I/root/php7-ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I /usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr /include/php/20151012/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/ local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /root/php7-ffmpeg /ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o 在来自 /usr/include/x86_64-linux-gnu/sys/stat.h:104:0 的文件中,来自 /usr/include /php/20151012/Zend/zend_stream.h:28,来自 /usr/include/php/20151012/Zend/zend.h:41,来自 /usr/include/php/20151012/main/php.h:36,来自/root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/x86_64-linux-gnu/bits/stat.h:91:21: 错误: 字段'st_atim' 的类型不完整 struct timespec st_atim; /* Time of last access.
/* 上次访问的时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:92:21: error: field 'st_mtim' has incomplete type struct timespec st_mtim;
/ ^ /usr/include/x86_64-linux-gnu/bits/stat.h:92:21: 错误: 字段'st_mtim' 的类型不完整 struct timespec st_mtim; / Time of last modification.
/上次修改时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:93:21: error: field 'st_ctim' has incomplete type struct timespec st_ctim;
/ ^ /usr/include/x86_64-linux-gnu/bits/stat.h:93:21: 错误: 字段'st_ctim' 的类型不完整 struct timespec st_ctim; / Time of last status change.
/上次状态更改的时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:152:21: error: field 'st_atim' has incomplete type struct timespec st_atim;
/ ^ /usr/include/x86_64-linux-gnu/bits/stat.h:152:21: 错误: 字段'st_atim' 的类型不完整 struct timespec st_atim; / Time of last access.
/上次访问的时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:153:21: error: field 'st_mtim' has incomplete type struct timespec st_mtim;
/ ^ /usr/include/x86_64-linux-gnu/bits/stat.h:153:21: 错误: 字段'st_mtim' 的类型不完整 struct timespec st_mtim; / Time of last modification.
/上次修改时间。 / ^ /usr/include/x86_64-linux-gnu/bits/stat.h:154:21: error: field 'st_ctim' has incomplete type struct timespec st_ctim;
/ ^ /usr/include/x86_64-linux-gnu/bits/stat.h:154:21: 错误: 字段'st_ctim' 的类型不完整 struct timespec st_ctim; / Time of last status change.
/上次状态更改的时间。 / ^ In file included from /usr/include/php/20151012/Zend/zend_stream.h:28:0, from /usr/include/php/20151012/Zend/zend.h:41, from /usr/include/php/20151012/main/php.h:36, from /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/x86_64-linux-gnu/sys/stat.h:364:31: error: array type has incomplete element type 'struct timespec' const struct timespec __times[2], ^ /usr/include/x86_64-linux-gnu/sys/stat.h:371:54: error: array type has incomplete element type 'struct timespec' extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
/ ^ 在 /usr/include/php/20151012/Zend/zend_stream.h:28:0 包含的文件中,来自 /usr/include/php/20151012/Zend/zend.h:41,来自 /usr/include/php /20151012/main/php.h:36,来自 /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/x86_64-linux-gnu/sys/stat.h:364:31: 错误:数组类型具有不完整的元素类型 'struct timespec' const struct timespec __times[2], ^ /usr/include/x86_64-linux-gnu/sys/stat.h:371:54: 错误:数组类型具有不完整的元素类型 'struct timespec' extern int futimens (int __fd, const struct timespec __times[2]) __THROW; ^ In file included from /usr/include/php/20151012/main/php.h:395:0, from /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/php/20151012/Zend/zend_virtual_cwd.h:218:2: error: unknown type name 'time_t' time_t expires;
^ 在 /usr/include/php/20151012/main/php.h:395:0 包含的文件中,从 /root/php7-ffmpeg/ffmpeg-php.c:40: /usr/include/php/20151012/Zend /zend_virtual_cwd.h:218:2: 错误:未知类型名称 'time_t' time_t 过期;
^ /usr/include/php/20151012/Zend/zend_virtual_cwd.h:248:86: error: unknown type name 'time_t' CWD_API realpath_cache_bucket realpath_cache_lookup(const char *path, int path_len, time_t t);^ /usr/include/php/20151012/Zend/zend_virtual_cwd.h:248:86: 错误:未知类型名称'time_t' CWD_API realpath_cache_bucket realpath_cache_lookup(const char *path, int path_len, time_t t); ^ /root/php7-ffmpeg/ffmpeg-php.c: In function 'zm_startup_ffmpeg': /root/php7-ffmpeg/ffmpeg-php.c:108:5: warning: implicit declaration of function 'avcodec_init' [-Wimplicit-function-declaration] avcodec_init();
^ /root/php7-ffmpeg/ffmpeg-php.c:在函数'zm_startup_ffmpeg'中:/root/php7-ffmpeg/ffmpeg-php.c:108:5:警告:函数'avcodec_init'的隐式声明[-Wimplicit-函数声明] avcodec_init(); ^ /root/php7-ffmpeg/ffmpeg-php.c:111:5: warning: 'av_register_all' is deprecated [-Wdeprecated-declarations] av_register_all();
^ /root/php7-ffmpeg/ffmpeg-php.c:111:5: 警告:'av_register_all' 已被弃用 [-Wdeprecated-declarations] av_register_all(); ^ In file included from /root/php7-ffmpeg/ffmpeg-php.c:43:0: /usr/local/include/libavformat/avformat.h:2025:6: note: declared here void av_register_all(void);
^ 在来自 /root/php7-ffmpeg/ffmpeg-php.c:43:0: /usr/local/include/libavformat/avformat.h:2025:6 的文件中:注意:此处声明为 void av_register_all(void);
^ Makefile:194: recipe for target 'ffmpeg-php.lo' failed make: *** [ffmpeg-php.lo] Error 1
Can someone give me a light?有人能给我一盏灯吗? I do not know what else to do!
我不知道还能做什么!
That ffmpeg-php is a long dead project that hasn't been updated for 10 years.那个 ffmpeg-php 是一个已经死了很久的项目,已经 10 年没有更新了。 Don't waste your time.
不要浪费你的时间。 If you must use a wrapper see FFmpegPHP or PHP-FFMpeg which appear to be actively maintained as of now.
如果您必须使用包装器,请参阅FFmpegPHP或PHP-FFMpeg ,它们目前似乎正在积极维护。
Do you even need a wrapper?你甚至需要一个包装吗? Perhaps you can just directly use the
ffmpeg
tool in your scripts.也许您可以直接在脚本中使用
ffmpeg
工具。 See FFmpeg Wiki: PHP .请参阅FFmpeg 维基: PHP 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.