 |
dbtcp-forums Support for dbtcp
|
| View previous topic :: View next topic |
| Author |
Message |
fruza Guest
|
Posted: Tue May 23, 2006 11:34 am Post subject: Compile PHP and DBTCP step by step |
|
|
Hi !!,
After several hours with problems and reading this forum I've successfully compiled my php-4.4.2 with dbtcp in both as a php extension module and included in php. I've done it in redhat 8.0 and Debian 3.1. These are the steps I've done, maybe are useful for others.
1) Download dbtcp software (dbtcp-latest.tar.gz) from http://www.fastflow.it/dbtcp/
2) tar -xzvf dbtcp-latest.tar.gz
3) mv dbtcp-0.1.18a /usr/local/dbtcp-0.1.18a
4) cd /usr/local/dbtcp-0.1.18a
5) make
We have created the dbtcp client. Let's do the rest with php:
6) cd /root/Software/Php/php-4.4.2/ext
7) cp -a /usr/local/dbtcp-0.1.18a/php/dbtcp .
8) cd dbtcp
9) chmod 755 ../../scripts/phpize # Don't know why this file isn't executable
10) chmod 755 ../../scripts/php-config # Don't know why this file isn't executable
11) ../../scripts/phpize --clean
12) ../../scripts/phpize
13) ./configure --with-dbtcp=/usr/local/dbtcp-0.1.18a --with-php-config=../../scripts/php-config
Now if we want to create dbtcp as a php extension we do the following:
14) make
15) make install
This last step install the library extension in lib/php/extensions/no-debug-non-zts-20020429 inside our php instalation directory. If we want to load the extension when Apache starts we have to include the following in the php.ini file:
extension_dir="/usr/local/php-4.3.2/lib/php/extensions/no-debug-non-zts-20020429"
extension=dbtcp.so
Also it can be loaded in runtime by the php program using the function: dl("dbtcp.so")
Instead, if you want to include dbtcp in the Php library, we do the following after step 13:
14) First of all, we have to edit the file php_dbtcp.h so that we change the line which include the config.h file with the following:
#include <ext/dbtcp/config.h>
This config.h has been created in the step 13 by the configure and it has to be right included so that php can be compiled correctly.
Finally we configure, make and install php. These are my options:
15) cd ../.. # we set in the php source root to compile php
16) autoconf # This modify the php configure script to add dbtcp support
17) ./configure --prefix=/usr/local/php-4.4.2 --with-apxs=/usr/bin/apxs --with-mysql --with-informix=/usr/local/informix --enable-sockets --with-ldap --with-dom --with-dom-xslt --with-dom-exslt --with-gd --with-zlib --with-dbtcp=/usr/local/dbtcp-0.1.18a
17) make
18) make install
I hope it will be useful for other people as it is for me.
Regards,
Fernando. |
|
| Back to top |
|
 |
fruza
Joined: 11 Jan 2007 Posts: 2
|
Posted: Mon Jan 15, 2007 12:32 pm Post subject: Compile PHP and DBTCP step by step II |
|
|
Hi again,
I've achieved to compile dbtcp in a Debian 3.1 Testing AMD64. I have followed exactly the same steps that my the above post but with a couple of modificactions, I guess it will be necessary for this architecture:
Before doing make in step 5, I have had to do a couple of modificacion in the Makefile:
1) A modification commented by Cristian here for the dbug.c file: http://dbtcp-forum.fastflow.it/viewtopic.php?t=85&highlight=make++dbug++libdbug
2) A modification with the following compilation option: -fPIC
CCFLAGS= -fPIC -g -O6 -D$(ARCH) -Wall -I$(LOCALDIR) -I$(LOCALDIR)/dbug -I$(LOCALDIR)/utils -L$(LOCALDIR)/libs
If not when is going to do the linking for PHP appears the following error:
/usr/bin/ld: /usr/local/dbtcp-0.1.18a/libs/libdbftp.a(protocol.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/dbtcp-0.1.18a/libs/libdbftp.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
I hope it will be useful for other people.
Regards,
Fernando. |
|
| Back to top |
|
 |
fruza
Joined: 11 Jan 2007 Posts: 2
|
Posted: Fri Jan 15, 2010 3:21 pm Post subject: Compile PHP and DBTCP step by step III |
|
|
Hi again,
I've compiled dbtcp-0.1.18a with the last stable php source code: php-5.3.1 in Debian Lenny AMD64 as an extension with the following steps (assuming we have installed php-5.3.1 in /opt/php):
1) Download dbtcp software (dbtcp-latest.tar.gz) from http://www.fastflow.it/dbtcp/
2) tar -xzvf dbtcp-latest.tar.gz
3) mv dbtcp-0.1.18a /opt/dbtcp-0.1.18a
4) cd /opt/dbtcp-0.1.18a
5) make
We have created the dbtcp client. Let's do the rest with php. Let's go to the php source directory, in my case for example in /root/software/php-5.3.1:
6) cd /root/software/php-5.3.1/ext
7) cp -a /opt/dbtcp-0.1.18a/php/dbtcp .
8) cd dbtcp
9) /opt/php/bin/phpize --clean
10) /opt/php/bin/phpize
11) ./configure --with-dbtcp=/opt/dbtcp-0.1.18a --with-php-config=/opt/php/bin/php-config
14) make
15) make install
This last step install the library extension in /opt/php/lib/php/extensions/no-debug-zts-20090626 inside our php instalation directory. If we want to load the extension when Apache starts we have to include the following in the php.ini file:
extension_dir="/opt/php/lib/php/extensions/no-debug-zts-20090626"
extension=dbtcp.so
And that's all.
Fernando. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|