tony2001 / ffmpeg-php

PHP extension for video editing, wrapping ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: expected specifier-qualifier-list before ‘time_t’

yousefdawod opened this issue · comments

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/bin/sh /home/share/ffmpeg-php/libtool --mode=compile cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/sys/stat.h:107,
from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:395,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/bits/stat.h:91: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:92: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:93: error: field ‘st_ctim’ has incomplete type
/usr/include/bits/stat.h:152: error: field ‘st_atim’ has incomplete type
/usr/include/bits/stat.h:153: error: field ‘st_mtim’ has incomplete type
/usr/include/bits/stat.h:154: error: field ‘st_ctim’ has incomplete type
In file included from /usr/include/php/main/php_streams.h:28,
from /usr/include/php/main/php.h:395,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/sys/stat.h:367: error: array type has incomplete element type
/usr/include/sys/stat.h:374: error: array type has incomplete element type
In file included from /usr/include/php/main/php.h:401,
from /home/share/ffmpeg-php/ffmpeg-php.c:40:
/usr/include/php/TSRM/tsrm_virtual_cwd.h:218: error: expected specifier-qualifier-list before ‘time_t’
/usr/include/php/TSRM/tsrm_virtual_cwd.h:246: error: expected declaration specifiers or ‘...’ before ‘time_t’
make: *** [ffmpeg-php.lo] Error 1

None of these structs are used in ffmpeg-php.c:
$ cat ffmpeg-php.c | grep stat
statement from your version.
$ cat ffmpeg-php.c | grep time_t
$

Make sure the headers are alright, especially the PHP headers, since /usr/include/php/ instead of /usr/include/php5 looks suspicious to me.

[root@localhost ffmpeg-php]# cat ffmpeg-php.c | grep stat
statement from your version.
[root@localhost ffmpeg-php]# cat ffmpeg-php.c | grep time_t
[root@localhost ffmpeg-php]#

I do not have a folder /usr/include/php5

How did you install PHP?
Using some packets? or did you build it yourself?

Also some more info about your system would be nice to have.

Centos 6.5
[root@localhost ~]# php -v
PHP 5.5.16 (cli) (built: Aug 22 2014 05:42:56)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

I had version 5.5.3 and the same problem and I did an update to the latest version

Make sure the headers actually belong to the same PHP version.
rpm -qf /usr/include/php should be enough

[root@localhost ~]# rpm -qf /usr/include/php
php55w-devel-5.5.16-1.w6.x86_64

And are you able to build any other PECL extension?

Ah, wait.
I've recalled that there was a similar issue previously: #1
What's your ffmpeg version?

ffmpeg 2.2.3

And are you using the extension sources from this very repository?
I'm able to reproduce your issue only if I revert the patches for the issue #1.

From here the steps to install the ffmpeg
http://www.cpanelkb.net/install-ffmpeg-mplayer-mencoder-mp4box-flvtool2/

###I'm able to reproduce your issue only if I revert the patches for the issue #1.
Do I edit the files and is it modified in this version I have?

Well, you've downloaded ffmpeg-php from the old, now defunct Sourceforge project.
But this project is on Github and is a fork of that old SF project.
Reporting issues in the old SF code makes no sense, use the sources from this repo and then report any issues you've encountered (if any).

I currently use the your version and not Sourceforge
I skip this step in the site because it did not work well

This particular problem was addressed in issue #1, so I can't see how you can use my version and still see the error.
Show me what you get with cat ffmpeg-php.c | grep include

Thanks for your help Now everything is good but there is a problem it seems is not compatible with the latest version

cat ffmpeg-php.c | grep include

give you permission to combine ffmpeg-php with code included in the
of the other code concerned, provided that you include the source code of
#include "config.h"
#include "php.h"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include "php_ini.h"
#include "php_globals.h"
#include "ext/standard/info.h"
#include "php_ffmpeg.h"
#include "ffmpeg_errorhandler.h"

++++++++++++++++++++++++++++++++++++++++++++++++++

php -v

PHP Warning: PHP Startup: ffmpeg: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
PHP 5.5.16 (cli) (built: Aug 22 2014 05:42:56)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

You have old (PHP 5.3) headers installed in your system.
Remove them (probably php-devel packet or something similar) and install PHP 5.5 headers instead.
You'll have to rebuild the extension after that