Re: [PHP-DEV] php/embed and php-config
Seems like php-config misses something.. :) php4/pear/scripts/php-config.in should propably be using PHP_LIBS and PHP_LDFLAGS. Now it uses EXTRA_LIBS only.. And for some reason PHP_LIBS is empty. Sounds like a pure synchronization issue to me. - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed and php-config
On Fri, 18 Oct 2002, Wez Furlong wrote: I've been playing with php/embed and stumbled on a slight problem with php-config - it doesn't include the paths for the libs: % php-config --libs -lrecode -lexpat -lsnmp -lpanel -lncurses -lmysqlclient -lming -lm -lintl -lgd -lfreetype -lpng -lz -ljpeg -lexslt -lxsltbreakpoint -lxml2 -lxslt -lz -lgdbm -lcurl -lbz2 -lz -lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl -lcrypt -lcurl -lssl -lcrypto -ldl -lz -lxml2 -lz -lm Seems like php-config misses something.. :) php4/pear/scripts/php-config.in should propably be using PHP_LIBS and PHP_LDFLAGS. Now it uses EXTRA_LIBS only.. And for some reason PHP_LIBS is empty. Sascha, can you enlighten us? :) --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed and php-config
OK, so /usr/lib/mysql was already in ld.so.conf. The only way I got this to build was: LD_LIBRARY_PATH=/usr/lib/mysql make wtf is going wrong here? Could it be a libtool problem? --Wez. On 18/10/02, Wez Furlong [EMAIL PROTECTED] wrote: When I try and link I get: /usr/i486-suse-linux/bin/ld: cannot find -lmysqlclient % locate mysqlclient /usr/lib/mysql/libmysqlclient.a /usr/lib/mysql/libmysqlclient.la /usr/lib/mysql/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so.10 /usr/lib/mysql/libmysqlclient.so.10.0.0 /usr/lib/mysql/libmysqlclient.so.6 /usr/lib/mysql/libmysqlclient.so.6.0.0 (I'm going to hack my ld.so.conf now). -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed
On Sun, 29 Sep 2002, Edin Kadribasic wrote: I have just committed initial work on enabling embedding PHP into C/C++ applications. It is mostly complete, but there a few pieces missing, namely the installation part. The modification of the build system adds another target, so in order to test the new functionality you need to configure php in the usual manner, and then do make, make install and make libs. Since libs are not installed by make install you need to copy libphp.so manually to appropriate directory. What about a libphp.a? :) Derick -- --- Derick Rethans http://derickrethans.nl/ JDI Media Solutions --[ if you hold a unix shell to your ear, do you hear the c? ]- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed
[EMAIL PROTECTED] wrote: On Sun, 29 Sep 2002, Edin Kadribasic wrote: I have just committed initial work on enabling embedding PHP into C/C++ applications. It is mostly complete, but there a few pieces missing, namely the installation part. The modification of the build system adds another target, so in order to test the new functionality you need to configure php in the usual manner, and then do make, make install and make libs. Since libs are not installed by make install you need to copy libphp.so manually to appropriate directory. What about a libphp.a? :) It will work, too. My I idea was having only libphp.so (the name is a little confusing, though) and install libphp.a and libphp.so for PlPhp. With the sapi, users are easier to set thing up right :) -- Yasuo Ohgaki -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed
On Sunday 29 September 2002 11:45, [EMAIL PROTECTED] wrote: On Sun, 29 Sep 2002, Edin Kadribasic wrote: I have just committed initial work on enabling embedding PHP into C/C++ applications. It is mostly complete, but there a few pieces missing, namely the installation part. The modification of the build system adds another target, so in order to test the new functionality you need to configure php in the usual manner, and then do make, make install and make libs. Since libs are not installed by make install you need to copy libphp.so manually to appropriate directory. What about a libphp.a? :) Forgot to mention it, but that one is built as well. Beware, linking the PHP engine staticly will increase your C app binary size by at least 2 MB. Edin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed
Going on a 'semi-consistant' naming structure on unix, would libphp.so.4.3.0 (softlinked to libphp.so) be an idea. this should be really good when working with bcompiler_load_exe() :) Regards Alan Edin Kadribasic wrote: On Sunday 29 September 2002 11:45, [EMAIL PROTECTED] wrote: On Sun, 29 Sep 2002, Edin Kadribasic wrote: I have just committed initial work on enabling embedding PHP into C/C++ applications. It is mostly complete, but there a few pieces missing, namely the installation part. The modification of the build system adds another target, so in order to test the new functionality you need to configure php in the usual manner, and then do make, make install and make libs. Since libs are not installed by make install you need to copy libphp.so manually to appropriate directory. What about a libphp.a? :) Forgot to mention it, but that one is built as well. Beware, linking the PHP engine staticly will increase your C app binary size by at least 2 MB. Edin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php/embed
very cool. On Saturday, September 28, 2002, at 10:56 PM, Edin Kadribasic wrote: Hello, I have just committed initial work on enabling embedding PHP into C/C++ applications. It is mostly complete, but there a few pieces missing, namely the installation part. The modification of the build system adds another target, so in order to test the new functionality you need to configure php in the usual manner, and then do make, make install and make libs. Since libs are not installed by make install you need to copy libphp.so manually to appropriate directory. The best way to explain how this works is to show you some code examples. pembed.c #include php_embed.h int main(int argc, char **argv) { char *php_code = echo \Hello, World!\\n\;; PHP_EMBED_START_BLOCK(argc, argv); zend_eval_string(php_code, NULL, Embedded code TSRMLS_CC); PHP_EMBED_END_BLOCK(); return 0; } Makefile (unix) === LIBS=-lphp $(shell php-config --libs) INCLUDES=$(shell php-config --includes) LIBDIRS=-L$(shell php-config --prefix)/lib PHP_EXE=$(shell php-config --prefix)/bin/php CC=gcc CFLAGS=-g -Wall pembed: pembed.o $(CC) $(CFLAGS) $(LIBDIRS) -o pembed $(LIBS) pembed.o pembed.o: pembed.c $(CC) $(CFLAGS) $(INCLUDES) -c pembed.c clean: rm -f *.o pembed Makefile (win32) # Put your compiled php source here ROOT=u:\projects\php\php4.sdk LIBS=php4ts.lib phpembed.lib INCLUDES=-I $(ROOT) -I $(ROOT)\main -I $(ROOT)\Zend -I $(ROOT)\TSRM LIBDIRS=/libpath:$(ROOT)\Release_TS CC=cl LD=link CFLAGS=-MD -D ZTS -D PHP_WIN32 -D ZEND_WIN32 pembed.exe: pembed.obj $(LD) $(LIBDIRS) /out:pembed.exe $(LIBS) pembed.obj pembed.obj: pembed.c $(CC) $(CFLAGS) $(INCLUDES) -c pembed.c clean: -del *.obj -del pembed.exe As you can see from the example pembed.c file it is not very difficult to get the PHP engine started using php/embed. There are some things that you need to notice: you should think of PHP_EMBED_START_BLOCK() and PHP_EMBED_END_BLOCK() as {} block, so take care not to intersect with other {} blocks. If this is too great a limitiation, functions int php_embed_init(int argc, char **argv PTSRMLS_DC); void php_embed_shutdown(TSRMLS_D); should be used instead. I'm looking forward to your feedback and help to get the make install part working. Edin -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php // George Schlossnagle // Principal Consultant // OmniTI, Inc http://www.omniti.com // (c) 240.460.5234 (e) [EMAIL PROTECTED] // 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php