can someone help me compiling php_arapi on Fedora 8 with PHP 5.2.4?
I've uncompressed php-5.2.4, then in the ext directory, i exectuted ./ext_skel --extname=arapi to create the arapi directory in extensions,
then inside ext/arapi i uncompressed the extension source (php_arapi.src-0.3.2.tar.gz),
the remedy api source (linux63p20.tar.gz) and the rtl lib source (rtl_beta3.zip).
then in php-5.2.4 i exectuted ./buildconf --force and ./configure --enable-arapi
and i get this error :
checking whether to enable Remedy AR System support... yes
checking for ARInitialization in -larapi63... no
configure: error: arapi63 is needed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I've used the wrong macro in the build files. So it will not find the library. I have in the TODO to fix this. But never had time. I have a standalone makefile I can send.
If I am lucky I might get some time on my current holiday to fix that problem. But I am not sure I have all the stuff on my computer. And with 5kbyte/s mobile internet it will not be high priority to download big files.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is two problems with the config.m4 in the current version. It only contains the name of the windows DLL. And I have not got it to work in windows anyway. Since dlopen() in cygwin as I use in windows does not seem to be able to confirm the DLL. I have to look into that little bit more.
First what everybody could try is to change arapi63 to only ar or libar, since that it the name of the .so for ARAPI in *nix. You need to have the include files from ARAPI somewhere. And you should tell where that is by --enable-arapi=<path>, the root of the ARAPI, it includes include/ automatically.
Otherwise you can use the following make on *nix. You have to change the paths.
root:/usr/local/src/arapi# ./configure --enable-arapi=/usr/local/src/arapi
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
...
...
checking whether to enable Remedy AR System support... yes, shared
checking for ARInitialization in -llibar... no
configure: error: libar is needed
The config.m4 looks like this. I shifted a couple lines during troubleshooting, but I still get the same errors:
PHP_ARG_ENABLE(arapi, whether to enable Remedy AR System support, [ --enable-arapi[=DIR] Enable Remedy AR System support])
if test "$PHP_ARAPI" != "no"; then
if test -r $PHP_ARAPI/include/ar.h; then
ARAPI_DIR=$PHP_ARAPI
else
ARAPI_DIR=/usr/local
fi
PHP_SUBST(ARAPI_SHARED_LIBADD)
PHP_NEW_EXTENSION(arapi, php_arapi.cpp, $ext_shared)
fi
Now, I've gone so far as to try your Makefile, and am getting errors after compile with the .so file. Same errors I see with the pre-compiled one, if I try to use that.
If I move my libphp5.so file into /usr/lib, I can satisfy this message, but it still causes errors in php -m.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20051025/php_arapi.so' - /usr/lib/libphp5.so: undefined symbol: ap_loaded_modules in Unknown on line 0
I'm fairly new with debugging compile errors, so I may overlook the obvious. I'm just trying to get this working for a client as soon as possible. In the short term I've installed the perl module for PHP in a hope that will get them by.
I had to tweek the Makefile in order to get it to work as follows.
CXX = g++
Two things. I see from the output of config.m4 that you should only specify ar, not libar. And from all the rest I can only se that you do not seem to have libar.so in the search path for libraries. Do you have libar.so on the machine. libar.so is the ARAPI. It should be version 6.3. Case php-arapi is only buildt/tested for this version. I might build away the use for RTL and make it compile for all the supporterd versions of ARAPI.
You can add the path to LD_LIBRARY_PATH when you run ldd. Then it should say it finds libar.so. Same goes to PHP, but I do not remember the setting in PHP. One option is to put both libar.so and php-arapi.so into the dir where all other extensions are.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Interested to see if anyone has the steps to successfully use this with SuSE
or ubuntu? How about PHP 5.3 support?
Running into the same issues as animal107 - when running configure in php, I
get the following:
.
.
checking for gzgets in -lz... yes
checking whether to enable Remedy AR System support... yes
checking for ARInitialization in -lar... no
configure: error: arapi is needed
Or, if there is are updated files, that would be nice as well. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the latest version it should find libar.so if you have that on your
system. What you might have to do to find libar.so on your system is to set
LD_LIBRARY_PATH. I think SuSE use that environment variable to set where it
should look for .so. libar.so comes with AR System and is the API for clients
to connect to the server.
PHP 5.3 support is currently not there. I have not tested, but the current
version should compile and run on 5.3 but without any 5.3 features. I have not
tried yet. So if anybody do, please report your finings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Compiles fine on 5.3.x. Respectively, 5.3.4,-5.3.8.
Only issue was with AR 7.6.0, Server.h and arextern.h had some argument count
discrepancies. I also added a arapi_api_version to my source for 18 (7.6.0) so
i could compile.
Works well but I get a segfault with it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Segfault sounds more like a miss match in compiler settings. But it can also
mean that something else in arapi code is not matching what is in the used
version of libar.so.
At the moment I have, as stated elsewhere on this forum, plans for a more or
less rewrite of the code without the RTL library. And when I do the base of
the code will be for the 'latest' version of PHP and ARAPI.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there anything you need assistance with? Not super strong in C++, but i got
access to any of the file's you should need and can test/help develop some.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was getting a seg fault due to 1300 of these errors (detec ted with
vaingaurd)
==12400== Use of uninitialised value of size 4
==12400== at 0x5AED851: des_encrypt1 (in /usr/lib/libar.so)
==12400== by 0xC08D08BF: ???
==12400==
I looked into the Libar.so file and realized that there was a bug with the one
i had from 7.6.0. Grabbed the libar.so from the ARWiki trunk, http://svn.arsw
iki.org/arapi/trunk/7.0/linux/lib/, and was set. No more segfaults.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
can someone help me compiling php_arapi on Fedora 8 with PHP 5.2.4?
I've uncompressed php-5.2.4, then in the ext directory, i exectuted ./ext_skel --extname=arapi to create the arapi directory in extensions,
then inside ext/arapi i uncompressed the extension source (php_arapi.src-0.3.2.tar.gz),
the remedy api source (linux63p20.tar.gz) and the rtl lib source (rtl_beta3.zip).
then in php-5.2.4 i exectuted ./buildconf --force and ./configure --enable-arapi
and i get this error :
checking whether to enable Remedy AR System support... yes
checking for ARInitialization in -larapi63... no
configure: error: arapi63 is needed
Sorry, I've used the wrong macro in the build files. So it will not find the library. I have in the TODO to fix this. But never had time. I have a standalone makefile I can send.
If I am lucky I might get some time on my current holiday to fix that problem. But I am not sure I have all the stuff on my computer. And with 5kbyte/s mobile internet it will not be high priority to download big files.
I'm having the same issue with Ubuntu linux(arapi63 is needed).
If you don't mind, I could also benefit from a standalone makefile.
There is two problems with the config.m4 in the current version. It only contains the name of the windows DLL. And I have not got it to work in windows anyway. Since dlopen() in cygwin as I use in windows does not seem to be able to confirm the DLL. I have to look into that little bit more.
First what everybody could try is to change arapi63 to only ar or libar, since that it the name of the .so for ARAPI in *nix. You need to have the include files from ARAPI somewhere. And you should tell where that is by --enable-arapi=<path>, the root of the ARAPI, it includes include/ automatically.
Otherwise you can use the following make on *nix. You have to change the paths.
Jens
CXX = g++
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@
.cpp.o:
$(CXXCOMPILE) -c -o $@ $<
ARAPI_DIR=/home/jens/dev/arapi
RTL_DIR=/home/jens/dev/rtl
PHPPATH=/usr/include/php
CPPFLAGS = -DCOMPILE_DL_ARAPI=1 -D_REENTRANT -malign-double
INCLUDES = -I. -I$(ARAPI_DIR)/include -I$(PHPPATH) -I$(PHPPATH)/main -I$(PHPPATH)/TSRM -I$(PHPPATH)/Zend -I$(RTL_DIR)
CXXFLAGS = -O2
LDFLAGS = -L/usr/libexec/apache -L$(ARAPI_DIR)/lib -shared -s
LIBS = -lstdc++ -lphp4 -ldl -lnsl -pthread -lar
php_arapi_SOURCES = php_arapi.cpp php_arapi.h
php_arapi_OBJECTS = php_arapi.o
all: php_arapi.so
clean:
$(RM) .o
$(RM) .lo
$(RM) php_arapi.so
php_arapi.so: $(php_arapi_OBJECTS) $(php_arapi_DEPENDENCIES)
$(CXXLINK) $(php_arapi_OBJECTS) $(LIBS)
Here's more information to help.
root:/usr/local/src/arapi# ./configure --enable-arapi=/usr/local/src/arapi
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
...
...
checking whether to enable Remedy AR System support... yes, shared
checking for ARInitialization in -llibar... no
configure: error: libar is needed
The config.m4 looks like this. I shifted a couple lines during troubleshooting, but I still get the same errors:
PHP_ARG_ENABLE(arapi, whether to enable Remedy AR System support,
[ --enable-arapi[=DIR] Enable Remedy AR System support])
if test "$PHP_ARAPI" != "no"; then
if test -r $PHP_ARAPI/include/ar.h; then
ARAPI_DIR=$PHP_ARAPI
else
ARAPI_DIR=/usr/local
fi
PHP_ADD_INCLUDE($ARAPI_DIR/include)
PHP_CHECK_LIBRARY(libar, ARInitialization,
PHP_ADD_LIBRARY_WITH_PATH(libar, $ARAPI_DIR/lib, ARAPI_SHARED_LIBADD)
AC_DEFINE(HAVE_ARAPI, 1, [Whether you have Remedy AR System)
],
AC_MSG_ERROR(libar is needed)
,
-L$ARAPI_DIR/lib
)
PHP_REQUIRE_CXX
PHP_ADD_INCLUDE($RTL_DIR)
PHP_ADD_LIBRARY(stdc++)
PHP_SUBST(ARAPI_SHARED_LIBADD)
PHP_NEW_EXTENSION(arapi, php_arapi.cpp, $ext_shared)
fi
Now, I've gone so far as to try your Makefile, and am getting errors after compile with the .so file. Same errors I see with the pre-compiled one, if I try to use that.
root:/usr/local/src/arapi# ldd php_arapi.so
linux-gate.so.1 => (0xffffe000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ecc000)
libphp5.so => not found
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7ec9000)
libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0xb7eb4000)
libar.so => not found
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e91000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e87000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e75000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d46000)
/lib/ld-linux.so.2 (0x80000000)
If I move my libphp5.so file into /usr/lib, I can satisfy this message, but it still causes errors in php -m.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20051025/php_arapi.so' - /usr/lib/libphp5.so: undefined symbol: ap_loaded_modules in Unknown on line 0
I'm fairly new with debugging compile errors, so I may overlook the obvious. I'm just trying to get this working for a client as soon as possible. In the short term I've installed the perl module for PHP in a hope that will get them by.
I had to tweek the Makefile in order to get it to work as follows.
CXX = g++
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
.cpp.o:
$(CXXCOMPILE) -c -o $@ $<
ARAPI_DIR = /usr/local/src/arapi
RTL_DIR = /usr/local/src/rtl
PHPPATH = /usr/include/php5
CPPFLAGS = -DCOMPILE_DL_ARAPI=1 -D_REENTRANT -malign-double
INCLUDES = -I. -I$(ARAPI_DIR)/include -I$(PHPPATH) -I$(PHPPATH)/main -I$(PHPPATH)/TSRM -I$(PHPPATH)/Zend -I$(RTL_DIR)
CXXFLAGS = -O2
LDFLAGS = -L/usr/lib/apache2/modules -L$(ARAPI_DIR)/lib -shared -s
LIBS = -lstdc++ -lphp5 -ldl -lnsl -pthread -lar
php_arapi_SOURCES = php_arapi.cpp php_arapi.h
php_arapi_OBJECTS = php_arapi.o
all: php_arapi.so
clean:
$(RM) .o
$(RM) .lo
$(RM) php_arapi.so
php_arapi.so: $(php_arapi_OBJECTS) $(php_arapi_DEPENDENCIES)
$(CXXLINK) $(php_arapi_OBJECTS) $(LIBS)
I hope you can help figure this one out. I'm at a loss here.
Thanks for answering so quickly!
Two things. I see from the output of config.m4 that you should only specify ar, not libar. And from all the rest I can only se that you do not seem to have libar.so in the search path for libraries. Do you have libar.so on the machine. libar.so is the ARAPI. It should be version 6.3. Case php-arapi is only buildt/tested for this version. I might build away the use for RTL and make it compile for all the supporterd versions of ARAPI.
You can add the path to LD_LIBRARY_PATH when you run ldd. Then it should say it finds libar.so. Same goes to PHP, but I do not remember the setting in PHP. One option is to put both libar.so and php-arapi.so into the dir where all other extensions are.
Interested to see if anyone has the steps to successfully use this with SuSE
or ubuntu? How about PHP 5.3 support?
Running into the same issues as animal107 - when running configure in php, I
get the following:
Or, if there is are updated files, that would be nice as well. Thanks!
With the latest version it should find libar.so if you have that on your
system. What you might have to do to find libar.so on your system is to set
LD_LIBRARY_PATH. I think SuSE use that environment variable to set where it
should look for .so. libar.so comes with AR System and is the API for clients
to connect to the server.
PHP 5.3 support is currently not there. I have not tested, but the current
version should compile and run on 5.3 but without any 5.3 features. I have not
tried yet. So if anybody do, please report your finings.
Compiles fine on 5.3.x. Respectively, 5.3.4,-5.3.8.
Only issue was with AR 7.6.0, Server.h and arextern.h had some argument count
discrepancies. I also added a arapi_api_version to my source for 18 (7.6.0) so
i could compile.
Works well but I get a segfault with it.
Thanks red for sharing the information.
Segfault sounds more like a miss match in compiler settings. But it can also
mean that something else in arapi code is not matching what is in the used
version of libar.so.
At the moment I have, as stated elsewhere on this forum, plans for a more or
less rewrite of the code without the RTL library. And when I do the base of
the code will be for the 'latest' version of PHP and ARAPI.
Is there anything you need assistance with? Not super strong in C++, but i got
access to any of the file's you should need and can test/help develop some.
FYI, wanted to post the following:
I was getting a seg fault due to 1300 of these errors (detec ted with
vaingaurd)
==12400== Use of uninitialised value of size 4
==12400== at 0x5AED851: des_encrypt1 (in /usr/lib/libar.so)
==12400== by 0xC08D08BF: ???
==12400==
I looked into the Libar.so file and realized that there was a bug with the one
i had from 7.6.0. Grabbed the libar.so from the ARWiki trunk, http://svn.arsw
iki.org/arapi/trunk/7.0/linux/lib/, and was set. No more segfaults.