我有一个带有PHP-7.0的NGINX服务器,我想安装ffmpeg-php扩展。我已经尝试了几天了,在很多方面。
到目前为止,使用的方法是手动编译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.tbz 2/下载)我遇到以下错误消息:
root@zumbiserver-水银:~/php7-ffmpeg# make /bin/bash /root/php7-ffmpeg/libtool -模式=编译cc -I。-I/root/php7-ffmpeg -DPHP_ATOM_INC -I/ root/ffmpeg/include -I/root/php7-ffmpeg/main -I/root/php7-ffmpeg -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -i/usr/main -I/usr/include/php/20151012/TSRM -i/usr/include/20151012/Zend-i/usr/php/20151012/-i/usr/包括/php/20151012/ext/lib/i/lib/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I /usr/local/包括/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-严格混叠-c /root/php7-ffmpeg/ffmpeg-php.c -o ffmpeg-php.c-o ffmpeg-I/root/php7-ffmpeg -DPHP_ATOM_INC -i/root/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/20151012/Zend-i/usr/php/20151012/-i/usr/包括/php/20151012/ext/lib-i/usr/lib/usr/usr。/local/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 -F-1-严格混叠-c /root/php7-ffmpeg/ffmpeg-c -fPIC -DPIC -o . .libs/ffmpeg-php.o/usr/include/x86_64-linux-gnu/sys/stat.h:104:0,从/usr/ /usr/include/php/20151012/Zend/zend_stream.h:28,/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 st_atim;最后一次访问的/*时间。/^ /usr/include/x86_64-linux-gnu/bits/stat.h:92:21:错误:字段‘st_mtim’有不完全类型的struct st_mtim;/ Time进行上次修改。/^ /usr/include/x86_64-linux-gnu/bits/stat.h:93:21:错误:字段‘st_ctim’具有不完全类型的st_ctim st_ctim;/ Time的上次状态更改。/^ /usr/include/x86_64-linux-gnu/bits/stat.h:152:21:错误:字段‘st_atim’具有不完全类型的struct st_atim;/。/^ /usr/include/x86_64-linux-gnu/bits/stat.h:153:21:错误:字段‘st_mtim’有不完全类型的struct st_mtim;/ Time进行上次修改。/^ /usr/include/x86_64-linux-gnu/bits/stat.h:154:21:错误:字段‘st_ctim’具有不完全类型的st_ctim st_ctim;/ Time的上次状态更改。/^在/usr/ /usr/include/php/20151012/Zend/zend_stream.h:28:0,/php/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’,^ /usr/include/x86_64-linux-gnu/sys/stat.h:371:54:错误:数组类型具有不完全元素类型‘struct’extern int (int __fd,__times2) __THROW;^在包含在/usr/include/php/main/php.h:395:0,from /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:错误:未知类型名称‘time_t’CWD_API realpath_cache_bucket realpath_cache_lookup(const *path,int path_len,time_t t);^ /root/php7-ffmpeg/ffmpeg-php.c:函数‘zm_startup_ffmpeg’:/root/php7-ffmpeg/ffmpeg-php.c:108:5:警告:函数‘avcodec_init’的隐式声明-W隐含-函数声明- avcodec_init();^/av_register_all/php7-ffmpeg/ffmpeg-php.c:111:5:警告:‘av_register_all’是弃用的-Wde推荐-声明av_register_all();^在文件中包含在/root/php7-ffmpeg/ffmpeg-php.c:43:0: av_register_all注释:在这里声明了av_register_all(Av_register_all); ^ Makefile:194:目标' ffmpeg-php.lo‘失败的配方:*ffmpeg-php.lo错误1
谁能给我点火吗?我不知道还能做什么!
发布于 2018-10-25 19:23:52
那个ffmpeg-php是一个很久没有更新的项目,已经有10年了。不要浪费你的时间。如果您必须使用包装器,请参阅FFmpegPHP或PHP-FFMpeg,它们似乎是目前正在积极维护的。
你需要包装吗?也许您可以直接在脚本中使用ffmpeg工具。见PHP : FFmpeg。
https://stackoverflow.com/questions/52995200
复制相似问题