PHP PDO_ODBC configure: error: C compiler cannot create executables - php

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!

Related

Get New Relic running in docker container

I'm trying to get New Relic running in a docker container (FROM php:7.3-apache) to push up to Cloud Run.
I've followed this documentation
https://docs.newrelic.com/docs/agents/php-agent/advanced-installation/docker-other-container-environments-install-php-agent/
For "Install agent and daemon in the same container" and added
RUN \
curl -L https://download.newrelic.com/php_agent/release/newrelic-php5-9.17.1.301-linux.tar.gz | tar -C /tmp -zx && \
export NR_INSTALL_USE_CP_NOT_LN=1 && \
export NR_INSTALL_SILENT=1 && \
/tmp/newrelic-php5-*/newrelic-install install && \
rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* && \
sed -i \
-e 's/"REPLACE_WITH_REAL_KEY"/"NRAK-xxxxxxxxxxxxxxxxxxx"/' \
-e 's/newrelic.appname = "PHP Application"/newrelic.appname = "My apps real name"/' \
-e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \
-e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \
/usr/local/etc/php/conf.d/newrelic.ini
To my docker file and switched the 3 variables to real values.
When I do PS inside the container it looks like it's running but nothing is appearing in the New Relic dashboard.
When I cat out php_agent.log I get
2021-06-21 19:06:34.870 +0000 (1 1) info: attempt daemon connection via '#newrelic'
2021-06-21 19:06:34.871 +0000 (1 1) info: New Relic 9.17.1.301 ("xigua" - "6498785b65c7") [daemon='#newrelic' php='7.3.28' zts=no sapi='apache2handler' apache='2.4.38' mpm=prefork pid=1 ppid=0 uid=0 euid=0 gid=0 egid=0 backtrace=yes
startup=agent os='Linux' rel='4.19.128-microsoft-standard' mach='x86_64' ver='#1 SMP Tue Jun 23 12' node='544d6a6fd26a']
2021-06-21 19:06:34.871 +0000 (1 1) warning: A global default license has not been set or has invalid format. Please add a 'newrelic.license' key in the global php.ini or in the newrelic.ini file, or ensure that a valid license is provided on a per-virtual host or per-directory basis.
When I cat out newrelic-daemon.log I get
2021/06/21 19:06:34.974122 (17) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen="#newrelic" startup=agent pid=17 ppid=1 uid=0 euid=0 gid=0 egid=0 runtime="go1.9.7" GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
2021/06/21 19:06:35.024983 (36) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen="#newrelic" startup=agent pid=36 ppid=17 uid=0 euid=0 gid=0 egid=0 runtime="go1.9.7" GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
2021/06/21 19:06:35.071290 (53) Info: New Relic daemon version 9.17.1.301-6498785b65c7 [listen="#newrelic" startup=agent pid=53 ppid=36 uid=0 euid=0 gid=0 egid=0 runtime="go1.9.7" GOMAXPROCS=24 GOOS=linux GOARCH=amd64]
2021/06/21 19:06:35.071516 (53) Info: collector configuration is &{CAFile: CAPath: Proxy:}
2021/06/21 19:06:35.071855 (53) Info: daemon listening on #newrelic
php --ini gives me
Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File: (none)
Scan for additional .ini files in: /usr/local/etc/php/conf.d
Additional .ini files parsed: /usr/local/etc/php/conf.d/docker-php-ext-imap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mysqli.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini,
/usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
/usr/local/etc/php/conf.d/newrelic.ini
When I cat /usr/local/etc/php/conf.d/newrelic.ini | grep "newrelic.license" I get my real correct key
; Setting: newrelic.license
newrelic.license = "NRAK-xxxxxxxxxxxxxxxxxxxxx"
What am I doing wrong or what step have I missed?
Your license key is wrong.
A global default license has not been set or has invalid format. Please add a 'newrelic.license' key in the global php.ini or in the newrelic.ini file, or ensure that a valid license is provided on a per-virtual host or per-directory basis.
It's appears that you are putting the user API_KEY: NRAK-xxxxxxxxxxxxxxxxxxxxx, but acctually you have to put your licence key found on Administration > API Keys > License Keys
You might want to also actually enable the extension:
newrelic.enabled=1
... that setting does not have a default value of true: https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-enabled

Undefined symbol: zend_type_to_string

I'm a bit new on ArchLinux but I have installed PHP 7 with pacman and after that Xdebug but Xdebug install the package php ( that is PHP 8 ).
When I tried to launch PHP 7 I got the following message and Xdebug doesn't work:
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /usr/lib/php7/modules/xdebug.so (/usr/lib/php7/modules/xdebug.so: undefined symbol: zend_type_to_string), /usr/lib/php7/modules/xdebug.so.so (/usr/lib/php7/modules/xdebug.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
That's my /etc/php7/conf.d/xdebug.ini
zend_extension=xdebug.so
;xdebug.remote_enable=on
;xdebug.remote_host=127.0.0.1
;xdebug.remote_port=9000
;xdebug.remote_handler=dbgp
;xdebug.start_with_request=yes
;xdebug.mode=debug
So if someone have the solution :)
I had the same problem.
So, I uninstalled PHP 8 and installed Xdebug for PHP 7.4:
yay -S xdebug7
I found the solution here !
$ asp update xdebug
$ asp export xdebug
After that i updated the PKGBUILD
$ cat PKGBUILD
--------------------------------------------------------------------
# Maintainer: Sergej Pupykin <pupykin.s+arch#gmail.com>
# Maintainer: Jonathan Wiersma <arch aur at jonw dot org>
# Contributor: Jonathan Wiersma <arch aur at jonw dot org>
# Contributor: sracker <smb.sac#gmail.com>
pkgname=xdebug-php7
pkgver=3.0.2
pkgrel=2
pkgdesc="PHP debugging extension for php7"
arch=('x86_64')
url="https://www.xdebug.org"
license=('GPL')
depends=('php7')
backup=('etc/php/conf.d/xdebug.ini')
source=("https://xdebug.org/files/xdebug-${pkgver}.tgz"
'xdebug.ini')
sha256sums=('096d46dec061341868d3e3933b977013a592e2e88992b2c0aba7fa52f87c4e17'
'7c66883dc2ade69069ef84e30188b25630748aa9c8b0dd123727c00505421205')
build() {
cd "$srcdir"/xdebug-${pkgver}
phpize7
./configure --prefix=/usr --enable-xdebug
make
}
package() {
cd "$srcdir"/xdebug-${pkgver}
make INSTALL_ROOT="$pkgdir" install
install -D -m 644 "$srcdir"/xdebug.ini "$pkgdir"/etc/php7/conf.d/xdebug.ini
}
--------------------------------------------------------------
And then i did that
makepkg -s -i -r

Writing a cron job using bluehost, php 5.6 fastcgi, and cakephp 3?

I have tested out the shell script by using putty to connect to my site, but I had to:
cd /home/username/bin //which is where my cake console is located
Then I could run the command, which was:
cake email second_user
I could not get this to work using the way described in the documentation where you just cd into the root folder and run the command bin/cake email second_user.
If I try it that way I get this error:
Failed loading /usr/php/56/usr/lib64/php/modules/ZendGuardLoader.so: /usr/php/56/usr/lib64/php/modules/ZendGuardLoader.so: undefined symbol: zend_new_interned_string
Failed loading /usr/php/56/usr/lib64/php/modules/opcache.so: /usr/php/56/usr/lib64/php/modules/opcache.so: undefined symbol: zend_new_interned_string
Status: 500 Internal Server Error
Content-type: text/html
This is also the same error I get when I try to setup the cron job with bluehost.
Cakephp 3 documentation says to use:
cd /full/path/to/root && bin/cake myshell myparam
I have tried using that type of command to no avail.
I then tried doing a work around version as well with the cron job where I just use the actual bin location to run cake like so:
php-cgi -c /home/username/public_html/php.ini /home/username/bin/cake email second_user > /home/username/logs/cron_logs.txt 2>&1
But I am getting this in my log file (which also has the same error as above):
Failed loading /usr/php/56/usr/lib64/php/modules/ZendGuardLoader.so: /usr/php/56/usr/lib64/php/modules/ZendGuardLoader.so: undefined symbol: zend_new_interned_string
Failed loading /usr/php/56/usr/lib64/php/modules/opcache.so: /usr/php/56/usr/lib64/php/modules/opcache.so: undefined symbol: zend_new_interned_string
################################################################################
#
# Cake is a shell script for invoking CakePHP shell commands
#
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# #copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
# #link http://cakephp.org CakePHP(tm) Project
# #since 1.2.0
# #license http://www.opensource.org/licenses/mit-license.php MIT License
#
################################################################################
# Canonicalize by following every symlink of the given name recursively
canonicalize() {
NAME="$1"
if [ -f "$NAME" ]
then
DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
fi
while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME")
SYM=$(readlink "$NAME")
NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
done
echo "$NAME"
}
CONSOLE=$(dirname -- "$(canonicalize "$0")")
APP=$(dirname "$CONSOLE")
exec php "$CONSOLE"/cake.php "$#"
exit
If I use cake.php (or any other command for that matter) instead of just cake, I just get the failed loading errors.
Also register_argc_argv is turned On.
Can someone please help?
I am not sure if this can be done. Since php 5.6 on bluehost is more of a beta testing, I can't get it to work. I had to switch to php 5.4 and I was then able to get cron jobs to work.

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.

Unable to install ffmpeg-php on Ubuntu 14.04

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?

Categories