[PHP] Extending PHP
Hi, I would like to know if anybody has had any luck in writing a PHP module, that uses an external (C) library, using ext_skel, buildconf/phpize... I've been reading the apidocs as well as "Web Application Development with PHP 4.0" but I still can't get it to work.. The problem is that allthough PHP is willing to load the compiled (PHP) module it can't find any of the functions provided by the external library What is wrong? When I try to use the library from a plain C-program there are no problems...Only when I try to use it from my PHP module... After 3½ day with the same stupid problem I am borderline crazy and beginning to get REALLY fed up with PHP ;-) Could it be a bug in the ext_skel "and friends" utilities??? Any suggestions will be greatly appreciated... Thanks Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sorry
For the inconvenience... I had some trouble with my mailclient yesterday... This is just a test to check if my new mailer is any better... Sorry... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Extending PHP
Hi Rasmus, Thank you for the link - and sorry about the empty messages ;-) The slides did help to some extend. But I'm only able to compile as described in slide 28. When I try to compile it as a shared module no .so file is generated. I do however get the following warnings: *** Warning: This library needs some functionality provided by -lstocks. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have. *** Warning: libtool could not satisfy all declared inter-library *** dependencies of module stocks. Therefore, libtool will create *** a static module, that should work as long as the dlopening *** application is linked with the -dlopen flag. The dlopening appliations is that PHP itself? BR Thomas Rasmus Lerdorf wrote: > > > After 3½ day with the same stupid problem I am borderline crazy and > > beginning to get REALLY fed up with PHP ;-) > > Could it be a bug in the ext_skel "and friends" utilities??? > > No, they work quite well. Try going to http://conf.php.net and pick the > New York Linuxworld Advanced presentation near the bottom. Then go to > slide #26. This is a walkthrough of building a simple extension which > adds functions for the external libstocks.a library > (http://libstocks.sourceforge.net/) > > Grab the library and try each step and see if you get a working extension > at the end of it. I have actually given this talk a couple of times and > performed each step right in front of everybody and ended up with a > perfectly working extension. > > -Rasmus > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] undefined symbol...
Hi, I've had alot of difficulties in compiling a module in PHP. Finally I'm almost there (I think). I've followed Lerdorf's libstock example. But whenever I try to run stocks.php (from Netscape)... I get this in apaches errorlog: undefined symbol: zend_hash_internal_poiner_ex The stocks example only uses zend_hash_internal_pointer_reset_ex, so I guess that the latter is a macro for the former... Anyhoo... Does anybody know how to resolve this issue??? TIA Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP 4.0.3 on Debian?
Hi again, Okay! I am now able to compile (and use) Lerdorfs stocks example on my Laptop which runs RedHat... But I still can't get it to work on my Debian (work machine). I use the following configure string on both machines - only differences is the paths to pgsql and apxs configure --enable-module=so --without-mysql --with-pgsql=/usr/local --with-stocks=shared On my RedHat (which has PHP 4.0.4) I get a nice little stocks.so... On my Debian (which has PHP 4.0.3) I get a not so nice little stocks.a I just noticed... That I get a warning when compiling on my Debian - I guess it's nothing, but I'm grasping for straws here... The warning is: Thomas:/usr/local/src/php4-4.0.3pl1# make install > fisse2 In file included from sapi_apache.c:58: /usr/local/src/php4-4.0.3pl1/php_version.h:3: warning: `PHP_VERSION' redefined /usr/local/src/php4-4.0.3pl1/main/php_version.h:3: warning: this is the location of the previous definition Is anybody able to compile .so files on Debian?? Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] file seems b0rken
Hi! $test=@file("some_non_existing_file"); Can somebody explain why count($test) is 1. When $test doesn't hold any data (which ofcourse is correct). Regards Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file seems b0rken
Arhh man, that was embarrasing... Thanks! I guess I didn't get enough coffee this morning :/ T. Cc Zona wrote: > > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Thomas Wentzel) wrote: > > > $test=@file("some_non_existing_file"); > > > > Can somebody explain why count($test) is 1. When $test doesn't hold any > > data > > From <http://www.php.net/manual/en/function.count.php>: > > "If var is not an array, 1 will be returned" > > When file() failed to open your non-existing file, it returned false. False > isn't an array, so count() returned 1. > > -- > CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Howto return multidimensional arrays from a PHP module
Hi all, I've been using array_init and add_assoc_xxx to return an array from within my PHP module... But how would I go about returning the following stucture Array (Array (Name, Type, Size)) tia T. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Howto return multidimensional arrays from a PHP module
Thomas Wentzel wrote: > > Hi Søren, > > Thank you very much for your answer, but I'm afraid that it isn't that > usefull to me... I don't have the luxury of using PHP as my PHP module > is written in C!! > > T. > > Soeren Staun-Pedersen wrote: > > > > On Mon, 5 Feb 2001, Thomas Wentzel wrote: > > > > > Hi all, > > > > > > I've been using array_init and add_assoc_xxx to return an array from > > > within my PHP module... But how would I go about returning the following > > > stucture > > > > $a = array(1,2,3,4); > > $b = arrar("foo"=>1,"bar"=>2); > > > > return $a; > > > > would work, as well as > > > > return $b; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]