Unable to install ffmpeg-php on Ubuntu 14.04 - php

I downloaded FFmpeg (version 2.2.3) and compiled with --disable-yasm and --enable-shared configuration and installed.
I then downloaded ffmpeg-php extension from here - http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/
I was able to phpize and configure successfully.
phpize output:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
php --version output:
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
But, when I try to make install my ffmpeg-php extension after successfully configuring, I am getting following error.
Error log:
/bin/bash /tmp/ffmpeg-php-0.6.0/libtool --mode=compile cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/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 /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -o ffmpeg-php.lo
libtool: compile: cc -I. -I/tmp/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/tmp/ffmpeg-php-0.6.0/include -I/tmp/ffmpeg-php-0.6.0/main -I/tmp/ffmpeg-php-0.6.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/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 /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o
In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:105:0,
from /usr/include/php5/main/php_streams.h:28,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/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; /* 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; /* 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; /* 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; /* 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; /* 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; /* Time of last status change. */
^
In file included from /usr/include/php5/main/php_streams.h:28:0,
from /usr/include/php5/main/php.h:396,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/sys/stat.h:365:31: error: array type has incomplete element type
const struct timespec __times[2],
^
/usr/include/x86_64-linux-gnu/sys/stat.h:372:54: error: array type has incomplete element type
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
^
In file included from /usr/include/php5/main/php.h:402:0,
from /tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:40:
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:218:2: error: unknown type name 'time_t'
time_t expires;
^
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:246:86: error: unknown type name 'time_t'
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC);
^
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c: In function 'zm_startup_ffmpeg':
/tmp/ffmpeg-php-0.6.0/ffmpeg-php.c:94:5: warning: implicit declaration of function 'avcodec_init' [-Wimplicit-function-declaration]
avcodec_init();
^
make: *** [ffmpeg-php.lo] Error 1
How can I solve this? Or is there any other php library which can be used to extract all metadata of a video like bit rate, frame rate etc?

Related

/php_intl.h:33:10: fatal error: 'unicode/ubrk.h' file not found

I'm trying to install intl on Mac os Ventura 13.0.1 with XAMPP 8.1.12 with pecl with this command:
sudo /Applications/XAMPP/xamppfiles/bin/pecl install intl
i cannot use directly pecl because i've also other installed php version.
Obviously i've already installed icu4c with command:
brew install icu4c
Here's result of brew list icu4c
/opt/homebrew/Cellar/icu4c/71.1/bin/derb
/opt/homebrew/Cellar/icu4c/71.1/bin/genbrk
/opt/homebrew/Cellar/icu4c/71.1/bin/gencfu
/opt/homebrew/Cellar/icu4c/71.1/bin/gencnval
/opt/homebrew/Cellar/icu4c/71.1/bin/gendict
/opt/homebrew/Cellar/icu4c/71.1/bin/genrb
/opt/homebrew/Cellar/icu4c/71.1/bin/icu-config
/opt/homebrew/Cellar/icu4c/71.1/bin/icuexportdata
/opt/homebrew/Cellar/icu4c/71.1/bin/icuinfo
/opt/homebrew/Cellar/icu4c/71.1/bin/makeconv
/opt/homebrew/Cellar/icu4c/71.1/bin/pkgdata
/opt/homebrew/Cellar/icu4c/71.1/bin/uconv
/opt/homebrew/Cellar/icu4c/71.1/include/unicode/ (189 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/libicudata.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicui18n.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicuio.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicutest.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicutu.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/libicuuc.71.1.dylib
/opt/homebrew/Cellar/icu4c/71.1/lib/icu/ (4 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/pkgconfig/ (3 files)
/opt/homebrew/Cellar/icu4c/71.1/lib/ (18 other files)
/opt/homebrew/Cellar/icu4c/71.1/sbin/escapesrc
/opt/homebrew/Cellar/icu4c/71.1/sbin/genccode
/opt/homebrew/Cellar/icu4c/71.1/sbin/gencmn
/opt/homebrew/Cellar/icu4c/71.1/sbin/gennorm2
/opt/homebrew/Cellar/icu4c/71.1/sbin/gensprep
/opt/homebrew/Cellar/icu4c/71.1/sbin/icupkg
/opt/homebrew/Cellar/icu4c/71.1/share/icu/ (4 files)
/opt/homebrew/Cellar/icu4c/71.1/share/man/ (15 files)
Now once i try to install intl with pecl i got this error:
cc -I. -I/private/var/tmp/pear/temp/intl -I/private/var/tmp/pear/temp/pear-build-rootQBIGcB/intl-3.0.0/include -I/private/var/tmp/pear/temp/pear-build-rootQBIGcB/intl-3.0.0/main -I/private/var/tmp/pear/temp/intl -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -I/include -DHAVE_CONFIG_H -g -O2 -Wno-write-strings -DZEND_COMPILE_DL_EXT=1 -c /private/var/tmp/pear/temp/intl/php_intl.c -MMD -MF php_intl.dep -MT php_intl.lo -fno-common -DPIC -o .libs/php_intl.o
In file included from /private/var/tmp/pear/temp/intl/php_intl.c:25:
In file included from /private/var/tmp/pear/temp/intl/php_intl.h:32:
/private/var/tmp/pear/temp/intl/collator/collator_sort.h:23:76: error: expected ')'
typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
^
/private/var/tmp/pear/temp/intl/collator/collator_sort.h:23:39: note: to match this '('
typedef int (*collator_compare_func_t)( zval *result, zval *op1, zval *op2 TSRMLS_DC );
^
In file included from /private/var/tmp/pear/temp/intl/php_intl.c:25:
/private/var/tmp/pear/temp/intl/php_intl.h:33:10: fatal error: 'unicode/ubrk.h' file not found
#include <unicode/ubrk.h>
^~~~~~~~~~~~~~~~
2 errors generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed
Once i start the install intl the script ask me:
Specify where ICU libraries and headers can be found [DEFAULT] :
i simple hint enter and got same error but i've also tried to use:
/opt/homebrew/Cellar/icu4c/71.1/include/unicode/
but same error appear
I'm loosing my mind with this problem!!

How to Install "RarArchive" on MacbookPro?

Anyone tried installing "
RarArchive
on their macbookpro? I tried installing but I got this error
.1.13/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -DRARDLL -DSILENT -Wno-write-strings -Wall -fvisibility=hidden -I/private/tmp/pear/temp/rar/unrar -DZEND_COMPILE_DL_EXT=1 -c /private/tmp/pear/temp/rar/rar_stream.c -MMD -MF rar_stream.dep -MT rar_stream.lo -fno-common -DPIC -o .libs/rar_stream.o
/private/tmp/pear/temp/rar/rar_stream.c:170:23: warning: format specifies type 'unsigned long' but the argument has type 'uint64' (aka 'unsigned long long') [-Wformat]
self->file_size, self->cursor);
^~~~~~~~~~~~
/private/tmp/pear/temp/rar/rar_stream.c:787:58: error: too many arguments to function call, expected 1, have 2
zend_string *arc_str = zend_resolve_path(tmp_archive, tmp_arch_len);
~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~
1 warning and 1 error generated.
make: *** [rar_stream.lo] Error 1
rolling back 454 file operations
ERROR: `make' failed
Cause I'm trying to solve this warning on my PHP IDE warning.
Thank you!
I tried installing via pecl but it did not work.
I fixed this issue by downgrading the PHP version from 8.1 to 8 and all the error is gone.
Hopefully, this will help others as well.

Extending and Embedding PHP and php 5.1.0

I am currently reading a book: Extending and Embedding PHP.
I have Ubuntu 16 . The book wants:
./configure <--- worked.
But with "make all install" I get a error message:
movic/Downloads/php-5.1.0/ext/dom/documenttype.c -o ext/dom/documenttype.lo
/home/tomovic/Downloads/php-5.1.0/meta_ccld -Iext/dom/ -I/home/tomovic/Downloads/php-5.1.0/ext/dom/ -DPHP_ATOM_INC -I/home/tomovic/Downloads/php-5.1.0/include -I/home/tomovic/Downloads/php-5.1.0/main -I/home/tomovic/Downloads/php-5.1.0 -I/usr/include/libxml2 -I/home/tomovic/Downloads/php-5.1.0/ext/date/lib -I/home/tomovic/Downloads/php-5.1.0/TSRM -I/home/tomovic/Downloads/php-5.1.0/Zend -D_REENTRANT -g -O2 -pthread -Wall -DZTS -c /home/tomovic/Downloads/php-5.1.0/ext/dom/documenttype.c -fPIC -DPIC -o ext/dom/.libs/documenttype.o
/home/tomovic/Downloads/php-5.1.0/ext/dom/documenttype.c: In function 'dom_documenttype_internal_subset_read':
/home/tomovic/Downloads/php-5.1.0/ext/dom/documenttype.c:219:42: error: dereferencing pointer to incomplete type 'xmlBuf {aka struct _xmlBuf}'
strintsubset = xmlStrndup(buff->buffer->content, buff->buffer->use);
^
Makefile:408: die Regel für Ziel „ext/dom/documenttype.lo“ scheiterte
make: *** [ext/dom/documenttype.lo] Fehler 1
root#DELL:~/Downloads/php-5.1.0#
Throw that book out and find another one.
PHP 5.1 is completely obsolete -- it was released in 2005, and has not been supported since the release of PHP 5.2 in November 2006. Due to changes in various libraries, it can no longer be compiled on modern Linux systems. Moreover, PHP has gone through a number of internal changes over the last 12 years, and much of the advice in that book is likely to be inaccurate today.
For an up-to-date look at PHP internals, refer to the PHP at the Core: A Hacker's Guide section of the PHP manual.

PHP: install mysqlnd_ms fail : make: *** [php_mysqlnd_ms.lo] error 1

I'm installing mysqlnd_ms package for php, but the make command reported an error:
make: *** [php_mysqlnd_ms.lo] Error 1
ERROR: `make' failed
my PHP version:
[root#uoo insFile]# php -v
PHP 5.6.12 (cli) (built: Aug 30 2015 00:04:44)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
my OS:
[root#uoo ~]# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core)
all php module that has been installed:
[root#uoo insFile]# php -m
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
ereg
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvsem
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib
[Zend Modules]
here is my installation process with pecl:
[root#uoo insFile]# pecl install mysqlnd_ms
downloading mysqlnd_ms-1.5.2.tgz ...
Starting to download mysqlnd_ms-1.5.2.tgz (385,916 bytes)
..............................................................................done:
385,916 bytes
36 source files, building
running: phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
building in /tmp/pear/temp/pear-build-rootvgIJMs/mysqlnd_ms-1.5.2
running: /tmp/pear/temp/mysqlnd_ms/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php
-I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory...
/usr/local/php/lib/php/extensions/no-debug-zts-20131226
checking for PHP installed headers prefix...
/usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to
regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable mysqlnd_ms support... yes, shared
checking whether to enable table filter in mysqlnd_ms... no
checking whether to query caching through mysqlnd_qc in mysqlnd_ms...
no
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-rootr7CW9Q/mysqlnd_ms-1.5.2/libtool
--mode=compile cc
-I. -I/tmp/pear/temp/mysqlnd_ms -DPHP_ATOM_INC
-I/tmp/pear/temp/pear-build-rootr7CW9Q/mysqlnd_ms-1.5.2/include
-I/tmp/pear/temp/pear-build-rootr7CW9Q/mysqlnd_ms-1.5.2/main
-I/tmp/pear/temp/mysqlnd_ms -I/usr/local/php/include/php
-I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM
-I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext
-I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2
-c /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c -o php_mysqlnd_ms.lo
mkdir .libs
cc -I. -I/tmp/pear/temp/mysqlnd_ms -DPHP_ATOM_INC
-I/tmp/pear/temp/pear-build-rootr7CW9Q/mysqlnd_ms-1.5.2/include -I/tmp/pear/temp/pear-build-rootr7CW9Q/mysqlnd_ms-1.5.2/main -I/tmp/pear/temp/mysqlnd_ms -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c -fPIC -DPIC -o .libs/php_mysqlnd_ms.o /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:
In function ‘zif_mysqlnd_ms_get_last_used_connection’:
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:293:2: warning: passing
argument 2 of ‘zval_to_mysqlnd’ makes integer from pointer without a
cast [enabled by default]
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^ In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: expected ‘unsigned int’ but argument is of type ‘void ***’
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:293:2: error: too few arguments to function ‘zval_to_mysqlnd’
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^ In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: declared here
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c: In function ‘zif_mysqlnd_ms_get_last_gtid’:
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:333:2: warning: passing
argument 2 of ‘zval_to_mysqlnd’ makes integer from pointer without a
cast [enabled by default]
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^ In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: expected ‘unsigned int’ but argument is of type ‘void ***’
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:333:2: error: too few arguments to function ‘zval_to_mysqlnd’
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^ In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: declared here
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:373:3: warning: passing argument 2 of ‘ms_ori mysqlnd_conn_methods->store_result’
makes integer from pointer without a cast [enabled▽by default]
if (!(res = MS_CALL_ORIGINAL_CONN_DATA_METHOD(store_result)(conn TSRMLS_CC))) {
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:373:3: note: expected ‘unsigned int’ but argument is of type ‘void ***’
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:373:3: error: too few
arguments to function ‘ms_orig_mysqlnd_conn_methods->store_result’
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c: In function
‘zif_mysqlnd_ms_set_qos’:
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:506:2: warning: passing
argument 2 of ‘zval_to_mysqlnd’ makes integer from pointer without a
cast [enabled by default]
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^
In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: expected ‘unsigned int’ but argument is of type ‘void ***’
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
/tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:506:2: error: too few arguments to function ‘zval_to_mysqlnd’
if (!(proxy_conn = zval_to_mysqlnd(handle TSRMLS_CC))) {
^
In file included from /tmp/pear/temp/mysqlnd_ms/mysqlnd_ms.h:40:0,
from /tmp/pear/temp/mysqlnd_ms/php_mysqlnd_ms.c:34:
/usr/local/php/include/php/ext/mysqlnd/mysqlnd_reverse_api.h:37:18:
note: declared here
PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int
client_api_capabilities, unsigned int * save_client_api_capabilities
TSRMLS_DC);
^
make: *** [php_mysqlnd_ms.lo] Error 1
ERROR: `make' failed
Try this:
svn checkout http://svn.php.net/repository/pecl/mysqlnd_ms/trunk/ && cd trunk && phpize && ./configure --with-php-config=/usr/bin/php-config && make
then run make install
then restart your apache.
I only tried this on php5.6. I'm not sure if this works on other version.
I have been looking hours and hours on the google finally the Clark's solution worked on cpanel just a bit of tweak
For cpanel I changed the command to:
svn checkout http://svn.php.net/repository/pecl/mysqlnd_ms/trunk/ && cd trunk && /opt/cpanel/ea-php56/root/usr/bin/phpize && ./configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config && make; make install
You also need to create and add the extension name in
/opt/cpanel/ea-php56/root/usr/lib64/php/modules/:
cd /opt/cpanel/ea-php56/root/usr/lib64/php/modules/
cat >> mysqlnd_ms.ini << EOF
extension=mysqlnd_ms.so
EOF
You can see result with php -m.
I was able to successfully install it via RPM package install. The links below may help you, depending on OS and PHP version you currently have. I mention this detail since this was originally posted a few years ago.
www.rpmfind.net
centos.pkgs.org
I simply followed the instructions from CentOS packages and the php pecl-svn extension installed with no issues on the Redhat 6.9 PHP 5.6 server. Hopefully the same works for you.

PHP PDO_ODBC configure: error: C compiler cannot create executables

I am trying to install PHP PDO_ODBC which i downloaded from PECL and i get the following error while running the configure command using
./configure --with-apxs=/opt/lampp/bin/apxs --with-php-config=/opt/lampp/bin/php-config --with-pdo-odbc=ibm-db2,/opt/ibm/db2/V9.7/
I am running the command as root and i am on a
Linux trisquel6 3.2.0-52-generic-pae #0trisquel1 SMP Thu Aug 22
22:04:28 UTC 2013 i686 i686 i386 GNU/Linux
My config.log file is pasted below
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --with-php-config=/opt/lampp/bin/php-config --with-pdo-odbc=ibm-db2,/opt/ibm/db2/V9.7/
## --------- ##
## Platform. ##
## --------- ##
hostname = trisquel6
uname -m = i686
uname -r = 3.2.0-52-generic-pae
uname -s = Linux
uname -v = #0trisquel1 SMP Thu Aug 22 22:04:28 UTC 2013
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2293: checking for grep that handles long lines and -e
configure:2351: result: /bin/grep
configure:2356: checking for egrep
configure:2418: result: /bin/grep -E
configure:2423: checking for a sed that does not truncate output
configure:2477: result: /bin/sed
configure:2609: checking for cc
configure:2625: found /usr/bin/cc
configure:2636: result: cc
configure:2667: checking for C compiler version
configure:2676: cc --version >&5
cc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2687: $? = 0
configure:2676: cc -v >&5
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configure:2687: $? = 0
configure:2676: cc -V >&5
cc: error: unrecognized option '-V'
cc: fatal error: no input files
compilation terminated.
configure:2687: $? = 4
configure:2676: cc -qversion >&5
cc: error: unrecognized option '-qversion'
cc: fatal error: no input files
compilation terminated.
configure:2687: $? = 4
configure:2707: checking whether the C compiler works
configure:2729: cc conftest.c >&5
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
configure:2733: $? = 1
configure:2771: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2776: error: in `/home/joshua/Downloads/PDO_ODBC-1.0.1/PDO_ODBC-1.0.1':
configure:2778: error: C compiler cannot create executables
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_EGREP='/bin/grep -E'
ac_cv_path_GREP=/bin/grep
ac_cv_prog_ac_ct_CC=cc
lt_cv_path_SED=/bin/sed
## ----------------- ##
## Output variables. ##
## ----------------- ##
AR=''
AWK=''
CC='cc'
CFLAGS=''
CONFIGURE_COMMAND=' '\''./configure'\'' '\''--with-php-config=/opt/lampp/bin/php-config'\'' '\''--with-pdo-odbc=ibm-db2,/opt/ibm/db2/V9.7/'\'''
CONFIGURE_OPTIONS=' '\''--with-php-config=/opt/lampp/bin/php-config'\'' '\''--with-pdo-odbc=ibm-db2,/opt/ibm/db2/V9.7/'\'''
CPP=''
CPPFLAGS=''
DEFS=''
DSYMUTIL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/bin/grep -E'
EXEEXT=''
GREP='/bin/grep'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
NMEDIT=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RE2C=''
SED='/bin/sed'
SHELL='/bin/bash'
SHLIB_DL_SUFFIX_NAME=''
SHLIB_SUFFIX_NAME=''
STRIP=''
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 77
The answer to this question is provided in this link
configure: error: C compiler cannot create executables when installing Ruby 1.9.3
doing
sudo apt-get install clang
and then
./configure --with-apxs=/opt/lampp/bin/apxs --with-php-config=/opt/lampp/bin/php-config --with-pdo-odbc=ibm-db2,/opt/ibm/db2/V9.7/ --with-gcc=clang
Works perfectly!

Categories