How to make Freeswitch ESL phpmod? - php

Freeswitch 1.5 is successfully installed, Fs_cli is working perfectly.
I am using Centos 6. I want to get ESL to work with PHP. so I have followed the steps written in Freeswitch Wiki for making ESL for PHP. but it is giving error as below :
make MYLIB=".././.libs/libesl.a" SOLINK="-shared -Xlinker -x" CFLAGS="-I/usr/local/src/freeswitch/libs/esl/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL" CXXFLAGS="-I/usr/local/src/freeswitch/libs/esl/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1" CXX_CFLAGS="" -C php
make[1]: Entering directory `/usr/local/src/freeswitch/libs/esl/php'
g++ -I/usr/local/src/freeswitch/libs/esl/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -I/usr/local/src/freeswitch/libs/esl/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/src/include -I/usr/local/src/freeswitch/libs/libteletone/src -fPIC -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -Wno-unused-label -Wno-unused-function -c esl_wrap.cpp -o esl_wrap.o
esl_wrap.cpp:741:18: error: zend.h: No such file or directory
esl_wrap.cpp:742:22: error: zend_API.h: No such file or directory
esl_wrap.cpp:743:29: error: zend_exceptions.h: No such file or directory
esl_wrap.cpp:744:17: error: php.h: No such file or directory
esl_wrap.cpp:745:37: error: ext/standard/php_string.h: No such file or directory
esl_wrap.cpp:1093:21: error: php_ini.h: No such file or directory
esl_wrap.cpp:1094:31: error: ext/standard/info.h: No such file or directory
esl_wrap.cpp:803: error: 'E_ERROR' was not declared in this scope
esl_wrap.cpp:824: error: ISO C++ forbids declaration of 'ZEND_RSRC_DTOR_FUNC' with no type
esl_wrap.cpp:824: error: 'SWIG_landfill' was not declared in this scope
esl_wrap.cpp:824: error: expected ',' or ';' before '{' token
esl_wrap.cpp:830: error: variable or field 'SWIG_ZTS_SetPointerZval' declared void
esl_wrap.cpp:830: error: 'zval' was not declared in this scope
esl_wrap.cpp:830: error: 'z' was not declared in this scope
esl_wrap.cpp:830: error: expected primary-expression before 'void'
esl_wrap.cpp:830: error: expected primary-expression before '*' token
esl_wrap.cpp:830: error: 'type' was not declared in this scope
esl_wrap.cpp:830: error: expected primary-expression before 'int'
make[1]: *** [esl_wrap.o] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch/libs/esl/php'
make: *** [phpmod] Error 2

Re-run ./configure in the top-level freeswitch source directory; that'll pick up the location of the relevant PHP headers. Then try to build the ESL lib again.
Once built, use make phpmod-install to install it.

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.

How to install memcached 3.1.4 for PHP 7.4 with brew on macOS Catalina?

The command pecl install memcached fails to compile:
[…]
ched/1.0.18_2/include -c /private/tmp/pear/temp/memcached/php_memcached.c -fno-common -DPIC -o .libs/php_memcached.o
/private/tmp/pear/temp/memcached/php_memcached.c:3237:7: error: expected ';' after expression
ulong key_index;
^
;
/private/tmp/pear/temp/memcached/php_memcached.c:3237:2: error: use of undeclared identifier 'ulong'
ulong key_index;
^
/private/tmp/pear/temp/memcached/php_memcached.c:3237:8: error: use of undeclared identifier 'key_index'
ulong key_index;
^
/private/tmp/pear/temp/memcached/php_memcached.c:3250:49: error: use of undeclared identifier 'key_index'
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(options), key_index, key, value) {
^
/private/tmp/pear/temp/memcached/php_memcached.c:3255:44: error: use of undeclared identifier 'key_index'
if (!php_memc_set_option(intern, (long) key_index, value)) {
[…]
[…]
sasl_done();
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sasl/sasl.h:727:18: note: 'sasl_done' has been explicitly marked deprecated here
LIBSASL_API void sasl_done(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_11,__IPHONE_NA,__IPHONE_NA);
^
2 warnings and 5 errors generated.
make: *** [php_memcached.lo] Error 1
ERROR: `make' failed
Xcode is up to date, PHP 7.4 is running fine, other packages installed with PECL are working good.
Memcached Version 3.1.5 was installed today without problems by running pecl install memcached

SOLVED: Compiling PHP with GD : relocation R_X86_64_PC32 against symbol `WebPMemoryWrite' can not be used when making a shared object;

I'm currently installing PHP with GD library from sources on a RedHat7 server and I'm facing some issues.
I configure PHP with this command:
./configure --with-apxs2=/server/lib/httpd/bin/apxs --with-pdo-mysql --with-config-file-path=/server/php-7.3.9/conf --with-libxml-dir=/server/lib/libxml2 --with-curl=/server/lib/curl --with-gd --enable-mbstring --with-jpeg-dir=/server/lib/libjpeg --with-png-dir=/server/lib/libpng –with-webp-dir=/server/lib/webp
It works but when I'm doing the make command I have this error:
/bin/ld: /server/lib/webp/lib/libwebp.a(picture_enc.o): relocation R_X86_64_PC32 against symbol `WebPMemoryWrite' can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [libphp7.la] Error 1
I also tried to compile and install it without webp (It's not required in the PHP documentation: php doc) but I have this error :
ext/gd/libgd/.libs/gd_webp.o: In function `gdImageCreateFromWebpCtx':
/server/php-7.3.9/ext/gd/libgd/gd_webp.c:68: undefined reference to `WebPGetInfo'
/sever/php-7.3.9/ext/gd/libgd/gd_webp.c:79: undefined reference to `WebPDecodeARGB'
ext/gd/libgd/.libs/gd_webp.o: In function `gdImageWebpCtx':
/server/php-7.3.9/ext/gd/libgd/gd_webp.c:153: undefined reference to `WebPEncodeRGBA'
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
So it seems to be required.
Can you please help me to solve this
Thanks
I resolved my issue by replacing my installation of webp package.
At first I used the pre-compiled linux package and replacing it by native sources and a compiling, make & make install solve the problem.
Thanks all

odbtp compiling error centos 7

I'm getting this php.h no such file or directory error
Change to the directory php/ext.
Open the file Makefile in an editor, such as vi, and change the value of PHP_INCROOT, if necessary. <--- what value? I use Centos 7
gcc -O2 -fpic -DHAVE_ODBTP -DCOMPILE_DL_ODBTP -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../.. -I./odbtp -o php_odbtp.o -c odbtp/php_odbtp.c
odbtp/php_odbtp.c:29:17: fatal error: php.h: No such file or directory
#include "php.h"
^
compilation terminated.
make: *** [php_odbtp.o] Error 1
Fixed. Installed Zend Framework, php_devel

Categories