Re: [PHP-DEV] GD broken ? compiler errors !
You just can't mix current CVS c sources witth current stable release. It would be like gambling. The GD module has new enhancements in it which aren't available in 4.2.2 so that won't work. Please first test with http://www.php.net/~zeev/php-4.2.3RC2.tar.gz or even better http://snaps.php.net/php4-latest.tar.bz2 and see if this isse has been fixed already. Any remaining errors should be reported via bugs.php.net (preferable against php4-latest). -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc In short, the window belongs to me. The document belongs to the web site designer. - Poster on opera.wishlist -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php script compilation
hi everybody, does anyone know if there is any opensource tool for compiling or bytecoding a php script? i know there is zend compiler but it costs too much. thanks Massimo -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] php script compilation
[EMAIL PROTECTED] wrote: hi everybody, does anyone know if there is any opensource tool for compiling or bytecoding a php script? i know there is zend compiler but it costs too much. thanks Massimo pear.php.net - look for bcompiler (very experimental) based on the compiler in apc (have a look at that as well.) http://www.ioncube.com/encoder/ (pay per build) and Zend encoder.. - buy this when you have money and support Zend :) Regards Alan -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] ZendEngine2 availability
Sorry if this is out of place, but is there any estimates as to when the famous Z2 might be ready? There is more (accurate) information in the archives of this list, but from what I recall, the estimates were about 6 months off. -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: PHP_SETUP_ICONV in acinclude.m4. Is it needed?
On Wed, 4 Sep 2002, Yasuo Ohgaki wrote: Title tells it. I suppose it should be done in ext/iconv/config.m4. Any reason not to doing it config.m4? Yes. It's needed elsewhere too. Only way to make sure it's available always (like with phpize'd builds) is to have it in acinclude.m4..like the openssl checks are. --Jani -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] ZendEngine2 availability
I'am also very interested in testing ZE2 Is there any way to have a nightly build using ZE2 added to the download list ? or maybe some periodic snapshots (with full windows builds please :)) that would really be great and allow people to start developping project that need ZE2 and serveral months of development. -Original Message- From: Tyson LT [mailto:[EMAIL PROTECTED]] Sent: mercredi 4 septembre 2002 07:38 To: [EMAIL PROTECTED] Subject: [PHP-DEV] ZendEngine2 availability Hi guys, Sorry if this is out of place, but is there any estimates as to when the famous Z2 might be ready? I am starting out a large OO project in PHP, and I would really like - love - to use some of the new features. Otherwise, is there somewhere I can get latest builds? Any indications are appreciated! -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ Pour mieux recevoir vos emails, utilisez un PC plus performant ! Découvrez la nouvelle gamme DELL en exclusivité sur i (france) http://www.ifrance.com/_reloc/signedell -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] array_diff_assoc()
Hi, the attached unified diffs can be used to add new function named array_diff_assoc(). This function works like array_diff() (and shares most of it code) but it is more restrictive. An element from the result array is removed if there is an element in arrays from 2 to N that has same value and same key. PHP script for testing is also attached. Regards, Andrey P.S. Note that basic_functions.c in the CVS is newer than mine. --- ../../../php4-200209030900/ext/standard/array.c Sat Aug 24 04:35:58 2002 +++ array.c Wed Sep 4 00:38:16 2002 -2588,9 +2588,7 } /* }}} */ -/* {{{ proto array array_diff(array arr1, array arr2 [, array ...]) - Returns the entries of arr1 that have values which are not present in any of the others arguments */ -PHP_FUNCTION(array_diff) +static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior TSRMLS_DC ) { zval ***args = NULL; HashTable *hash; -2614,20 +2612,23 set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; iargc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #%d is not an array, i+1); + php_error(E_WARNING, Argument #%d to array_diff() is not an array, i+1); argc = i; /* only free up to i-1 */ goto out; } hash = HASH_OF(*args[i]); list = (Bucket **) pemalloc((hash-nNumOfElements + 1) * sizeof(Bucket *), hash-persistent); if (!list) -RETURN_FALSE; + RETURN_FALSE; lists[i] = list; ptrs[i] = list; for (p = hash-pListHead; p; p = p-pListNext) -*list++ = p; + *list++ = p; *list = NULL; - zend_qsort((void *) lists[i], hash-nNumOfElements, sizeof(Bucket *), array_data_compare TSRMLS_CC); + if (behavior == 1) + zend_qsort((void *) lists[i], hash-nNumOfElements, sizeof(Bucket *), array_key_compare TSRMLS_CC); + else + zend_qsort((void *) lists[i], hash-nNumOfElements, sizeof(Bucket *), array_data_compare TSRMLS_CC); } /* copy the argument array */ -2635,16 +2636,29 zval_copy_ctor(return_value); /* go through the lists and look for values of ptr[0] - that are not in the others */ + that are not in the others */ while (*ptrs[0]) { c = 1; for (i=1; iargc; i++) { - while (*ptrs[i] (0 (c = array_data_compare(ptrs[0], ptrs[i] TSRMLS_CC -ptrs[i]++; - if (!c) { -if (*ptrs[i]) + if (behavior == 0){ +while (*ptrs[i] (0 (c = array_data_compare(ptrs[0], ptrs[i] TSRMLS_CC + ptrs[i]++; + }else if (behavior == 1){ +while (*ptrs[i] (0 (c = array_key_compare(ptrs[0], ptrs[i] TSRMLS_CC ptrs[i]++; -break; + } + if (!c) { +if (behavior == 0){ + if (*ptrs[i]) + ptrs[i]++; + break; +}else if (behavior == 1){ + if (*ptrs[i]){ + if (array_data_compare(ptrs[0], ptrs[i] TSRMLS_CC) != 0){ + c = -1; + } + } +} } } if (!c) { -2658,8 +2672,13 zend_hash_index_del(Z_ARRVAL_P(return_value), p-h); if (!*++ptrs[0]) goto out; -if (array_data_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) - break; +if (behavior == 0){ + if (array_data_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) + break; +}else{ + if (array_key_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) /* always ==1 */ + break; +} } } else { /* ptrs[0] in none of the other arguments */ -2667,22 +2686,45 for (;;) { if (!*++ptrs[0]) goto out; -if (array_data_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) - break; +if (behavior == 0){ + if (array_data_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) + break; +}else{ + if (array_key_compare(ptrs[0]-1, ptrs[0] TSRMLS_CC)) /* always ==1 */ + break; +} } } } out: for (i=0; iargc; i++) { - hash = HASH_OF(*args[i]); + hash = HASH_OF(*args[i]); pefree(lists[i], hash-persistent); } efree(ptrs); efree(lists); efree(args); } + + +/* {{{ proto array array_diff(array arr1, array arr2 [, array ...]) + Returns the entries of arr1 that have values which are not present in any of the others arguments */ +PHP_FUNCTION(array_diff) +{ + php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0 TSRMLS_CC); +} /* }}} */ + +/* {{{ proto array array_diff_assoc(array arr1, array arr2 [, array ...]) + Returns the entries of arr1 that have values which are not present in any of the others arguments */ +PHP_FUNCTION(array_diff_assoc) +{ + php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1 TSRMLS_CC); +} +/* }}} */ + + #define MULTISORT_ORDER 0 #define MULTISORT_TYPE 1 #define MULTISORT_LAST 2 -3420,3 +3462,4 * vim600: noet sw=4 ts=4 fdm=marker * vim600: noet sw=4 ts=4 */ + --- ../../../php4-200209030900/ext/standard/php_array.h Mon May 13 20:36:10 2002 +++ php_array.h Tue Sep 3 07:31:01 2002 -76,6 +76,7 PHP_FUNCTION(array_unique); PHP_FUNCTION(array_intersect); PHP_FUNCTION(array_diff); +PHP_FUNCTION(array_diff_assoc); PHP_FUNCTION(array_sum); PHP_FUNCTION(array_filter);
[PHP-DEV] long long data type in libmysql.
Hi, We are working on porting PHP onto NetWare. PHP-4.2.2 sources for libmysql seem to be using the data type long long and we are facing some problems handling this data type. We see extensive use of _WIN32 and _MSC_VER in these files and so we are sure that it was compiled with MSVC. But we got to understand from a reliable source that Microsoft C compiler doesn't understand this data type. Correct us if we are wrong. Can someone let us know how MSVC managed to handle the data type long long? Thanks, Ananth. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] long long data type in libmysql.
On Wed, 4 Sep 2002, Ananth Kesari wrote: Hi, We are working on porting PHP onto NetWare. PHP-4.2.2 sources for libmysql seem to be using the data type long long and we are facing some problems handling this data type. We see extensive use of _WIN32 and _MSC_VER in these files and so we are sure that it was compiled with MSVC. But we got to understand from a reliable source that Microsoft C compiler doesn't understand this data type. Correct us if we are wrong. Can someone let us know how MSVC managed to handle the data type long long? MSVC uses __int64. -Robert. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] long long data type in libmysql.
Hi, libmysql compiles fine on win32 using MSVC. Have a look at ext\mysql\libmysql\libmysql.dsp on which defines are used. Edin - Original Message - From: Ananth Kesari [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 1:02 PM Subject: [PHP-DEV] long long data type in libmysql. Hi, We are working on porting PHP onto NetWare. PHP-4.2.2 sources for libmysql seem to be using the data type long long and we are facing some problems handling this data type. We see extensive use of _WIN32 and _MSC_VER in these files and so we are sure that it was compiled with MSVC. But we got to understand from a reliable source that Microsoft C compiler doesn't understand this data type. Correct us if we are wrong. Can someone let us know how MSVC managed to handle the data type long long? Thanks, Ananth. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] --disable-all / --enable-all
Great! Derick On Wed, 4 Sep 2002, Jani Taskinen wrote: Attached patch adds --disable-all / --enable-all configure options to disable/enable all extensions You can do something like this now (tested): ./configure --disable-all --with-zlib To only include zlib extension. Or the other way around (untested): ./configure --enable-all --without-zlib And of course (totally untested..): ./configure --enable-all=shared,/usr/local This only affects those extensions which use the PHP_ARG_* macros. The patch adds one extra parameter to them to tell which options are 'extension' options. Any option which should not be enabled automatically should have it set to 'no'. (default for it is 'yes') Please test this. I don't want to commit it before I hear some positive comments.. phpize'd builds should be tested also. (I did try that, and it works.. :) --Jani --- Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ --- PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: A little help needed - get_filename() and get_linenum()
Appologies :) That was a quick fix! heh Thanks for your help, Hello! You probably did not see magic constants __FILE__ and __LINE__ in PHP manual ? Check this: http://si.php.net/manual/en/language.constants.php Cheers, Dejan Dan Hardiker [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... | Hi All, | | Im looking at developing a couple of functions which could retrieve the | current line number, and filename where ever they are put. By file name, I | mean the actual file name, not the parent (eg: the file that included this | one)... very similar to what would be outputted in a syntax error or such. | | A scenario where this would be useful would be in include files: | | ?php | if ($_SERVER[SCRIPT_FILENAME] == get_filename()) { | die(Dont talk to me!); | // or a header redirect, you get the jist | } | ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FOR ALAN: bcompiler
[EMAIL PROTECTED] wrote: Hi, i have tried bcompiler and read the installing instructions. i unpack, run phpize, run buildconf and configure (using --with-bcompiler) but i get a sitax error on line 11094 in configure and the execution aborts. have you any suggest? It's probably better to discuss it on [EMAIL PROTECTED] which version of php are you building it with - I've mainly tested with 4.3-dev, not tested in the last few days with php4.2* Also please use the latest CVS version of bcompiler - I've just fixed the decompiling stuff today, so it should all be working. And there is an example of a full script compiler in the examples directory (its easier to build as an extension) - just download run phpize in the directory ./configure make install no real need to put it in ext/bcompiler (i need to update the manual to reflect that.) Regards Alan bye Massimo -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: #19212 [Com]: Socket extension won't compile
On 4 Sep 2002 [EMAIL PROTECTED] wrote: Have hunch this is a bug in ext/sockets/config.m4. Index: ext/sockets/config.m4 === RCS file: /repository/php4/ext/sockets/config.m4,v retrieving revision 1.10 diff -u -r1.10 config.m4 --- ext/sockets/config.m4 12 May 2002 17:28:12 - 1.10 +++ ext/sockets/config.m4 4 Sep 2002 14:27:07 - @@ -12,8 +12,8 @@ AC_TRY_COMPILE([ #include sys/types.h #include sys/socket.h - ], [static struct msghdr tp; int n = (int) tp.msg_flags; return n], -[AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])] + ], [static struct msghdr tp; int n = (int) tp.msg_flags; return n], [ ], +[AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [Whether struct msghdr has msg_flags])] ) AC_DEFINE([HAVE_SOCKETS], 1, [ ]) -- Melvyn. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] __LINE__, __FILE__ and function()
Hi all, Sorry if this isn't an interesting feature for anyone else, but it would prove to be very useful for me. In the following test case: ?php function output($line=__LINE__) { echo Function called on line $linebr; } output(); output(); ? The variable $line is calculated once as the start of the script (with $line always being 3) where as the desired effect would surely be for it to be calculated each time the function is called, with the output being 7 and 8 respectivly. Im guessing this is a feature of whatever handles the building / assigning of functions, but I really dont know the php / zend source well enough to say. How much work would one be looking at to alter this functionality? Are there any reasons why this hasnt already been done? Thanks again, -- Dan Hardiker [[EMAIL PROTECTED]] ADAM Software Systems Engineer First Creative Ltd -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] SAPI/CGI and error_log()
At 22:24 28.08.2002, [EMAIL PROTECTED] wrote: On Wed, 28 Aug 2002, Marcus Börger wrote: Results with yesturdays sources: cgi without server: [marcus@zaphod sebastian-bergmann]$ /usr/src/php4/php error-log.php Status: 200 Content-type: text/html X-Powered-By: PHP/4.3.0-dev Building mod_php again with todays changes mod_php was not the problem, CGI without server is the prob... Derick The problem did only occur when not using ini setting error_log = filename. Therfore it took some time beeing able to reproduce this. Could you please verify my patch on cgi_main.c to fix this issue? marcus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-CVS] cvs: php4 /sapi/cgi cgi_main.c
Marcus Börger wrote: helly Wed Sep 4 11:30:59 2002 EDT Modified files: /php4/sapi/cgi cgi_main.c Log: Fix headers when default content type is used. #THIS fixes the problems with error_log() Thank you! -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] SAPI/CGI and error_log()
Marcus Börger wrote: Could you please verify my patch on cgi_main.c to fix this issue? The test script I submitted works ok now. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PHP 4.2.3 release.
Hi Guys, I don't know exactly when you plan to release PHP 4.2.3 as a final release but I believe I just found a bug that I haven't seen reported on bugs.php.net or in any of the php-dev threads, unfortunately, I will not be able to confirm this bug until friday night, time at which I will recompile our development server. The bug concerns passing multi-dimensional arrays in $_POST via form/POST, there is an obvious parsing error on my 4.2.3RC1 that makes it impossible to pass it a multi-dimensional array. e.g. select name=fields[tech_id[]] multiple size=3 option value=testtest/option option value=AdamAdam/option option value=EricEric/option option value=MarcMarc/option option value=DrewDrew/option option value=DougDoug/option option value=XavierXavier/option /select This should give us $_POST[fields[tech_id[0]]], 1, 2, 3, etc... in fact, here is what it gives me: [tech_id[]= string(4) Doug Thanks, Xavier Spriet. [EMAIL PROTECTED] (519)-945-2032 Ext. 233 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP 4.2.3 release.
Hey, did this ever work at all? AFAIK you can only use [] _once_ to denote it's an array. Derick On 4 Sep 2002, Xavier Spriet wrote: Hi Guys, I don't know exactly when you plan to release PHP 4.2.3 as a final release but I believe I just found a bug that I haven't seen reported on bugs.php.net or in any of the php-dev threads, unfortunately, I will not be able to confirm this bug until friday night, time at which I will recompile our development server. The bug concerns passing multi-dimensional arrays in $_POST via form/POST, there is an obvious parsing error on my 4.2.3RC1 that makes it impossible to pass it a multi-dimensional array. e.g. select name=fields[tech_id[]] multiple size=3 option value=testtest/option option value=AdamAdam/option option value=EricEric/option option value=MarcMarc/option option value=DrewDrew/option option value=DougDoug/option option value=XavierXavier/option /select This should give us $_POST[fields[tech_id[0]]], 1, 2, 3, etc... in fact, here is what it gives me: [tech_id[]= string(4) Doug Thanks, Xavier Spriet. [EMAIL PROTECTED] (519)-945-2032 Ext. 233 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php --- Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ --- PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP 4.2.3 release.
This is not a bug. Your syntax is wrong. It should be: fields[tech_id][] -Rasmus On 4 Sep 2002, Xavier Spriet wrote: Hi Guys, I don't know exactly when you plan to release PHP 4.2.3 as a final release but I believe I just found a bug that I haven't seen reported on bugs.php.net or in any of the php-dev threads, unfortunately, I will not be able to confirm this bug until friday night, time at which I will recompile our development server. The bug concerns passing multi-dimensional arrays in $_POST via form/POST, there is an obvious parsing error on my 4.2.3RC1 that makes it impossible to pass it a multi-dimensional array. e.g. select name=fields[tech_id[]] multiple size=3 option value=testtest/option option value=AdamAdam/option option value=EricEric/option option value=MarcMarc/option option value=DrewDrew/option option value=DougDoug/option option value=XavierXavier/option /select This should give us $_POST[fields[tech_id[0]]], 1, 2, 3, etc... in fact, here is what it gives me: [tech_id[]= string(4) Doug Thanks, Xavier Spriet. [EMAIL PROTECTED] (519)-945-2032 Ext. 233 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP 4.2.3 release.
Would the select name=fields['tech_id'][] syntax work? That should give an identical array, if I'm seeing what you're doing right. Mike - Original Message - From: [EMAIL PROTECTED] To: Xavier Spriet [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 6:47 PM Subject: Re: [PHP-DEV] PHP 4.2.3 release. Hey, did this ever work at all? AFAIK you can only use [] _once_ to denote it's an array. Derick -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP 4.2.3 release.
Beat me to it! :-) - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Xavier Spriet [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 6:50 PM Subject: Re: [PHP-DEV] PHP 4.2.3 release. This is not a bug. Your syntax is wrong. It should be: fields[tech_id][] -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PHP 4.2.3 release.
my bad... it was indeed a user error... Thanks everyone ;) On Wed, 2002-09-04 at 14:09, Mike Hall wrote: Beat me to it! :-) - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: Xavier Spriet [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 6:50 PM Subject: Re: [PHP-DEV] PHP 4.2.3 release. This is not a bug. Your syntax is wrong. It should be: fields[tech_id][] -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Segfault in 4.2.3RC2
Obviously PHP 4.2.3RC2 segfaults when using wordwrap() with the following configure options: './configure' \ '--with-config-file-path=/etc' \ '--with-exec-dir=/var/www/php-bin' \ '--enable-safe-mode' \ '--enable-calendar' \ '--with-mysql=/usr/local/mysql/current' \ '--with-pgsql=/usr/local/pgsql/current' \ '--with-mm' \ '--with-zlib' \ '--with-bz2' \ '--enable-memory-limit' \ '--disable-debug' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--enable-trans-sid' \ '--with-regex=system' \ '--enable-track-vars' \ '--with-recode' \ '--enable-xslt' \ '--with-xslt-sablot=/usr' \ '--with-expat-dir=/usr' (I know that the configure options aren't that nice possibly, but they should give you the clue how the system is set up.) The script to reproduce the segfault can be found at http://www.martinjansen.com/php/segfault-4.2.3RC2.txt. If you need more information (backtrace etc.), just ask. -- - Martin Martin Jansen http://martinjansen.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Segfault in 4.2.3RC2
On Wed, 4 Sep 2002, Martin Jansen wrote: The script to reproduce the segfault can be found at http://www.martinjansen.com/php/segfault-4.2.3RC2.txt. If you need more information (backtrace etc.), just ask. That link gives a four oh four to me... Derick --- Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ --- PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net --- -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Segfault in 4.2.3RC2
me too.. - Original Message - From: [EMAIL PROTECTED] To: Martin Jansen [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 9:37 PM Subject: Re: [PHP-DEV] Segfault in 4.2.3RC2 On Wed, 4 Sep 2002, Martin Jansen wrote: The script to reproduce the segfault can be found at http://www.martinjansen.com/php/segfault-4.2.3RC2.txt. If you need more information (backtrace etc.), just ask. That link gives a four oh four to me... Derick -- - Did I help you? http://www.derickrethans.nl/link.php?url=giftlist Frequent ranting: http://www.derickrethans.nl/ -- - PHP: Scripting the Web - [EMAIL PROTECTED] All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net -- - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] header(Content-type: text/...) with default_charset
Hi, header(Content-type: text/plain) or header(Content-type: text/xml) does not work as soon as a default_charset is enabled in php.ini. I reported that in http://bugs.php.net/bug.php?id=19098 a week ago, but nobody answered yet. This bug is still there in php-4.2.3RC2. If you use the mod_php version with Apache, you will get Content-type: text/html if you use header(Content-type: text/plain) or header(Content-type: text/xml). Here's a small test script (header_test.php) to show the problem. It calls the CGI version of php (in the current directory) and tries a few Content-type headers: ? $PHP = ./php -c .; $Headers = array(Content-type: text/plain, Content-type: text/xml, Content-type: application/xml, Content-type:text/plain, Content-type:text/plain , Content-type:text/longertextsubtype, Content-type: text/plain;charset=iso-8859-1, Content-type: text/plain; charset=UTF-8); foreach($Headers as $Header) { $Cmd = echo \?php header('$Header') ?\ | $PHP ; unset($Output); exec($Cmd, $Output); print Header: \$Header\\nOutput: \$Output[1]\\n\n; } ? The output of that script: # ./php -c . -q header_test.php Header: Content-type: text/plain Output: Content-type Header: Content-type: text/xml Output: Content-type Header: Content-type: application/xml Output: Content-type: application/xml Header: Content-type:text/plain Output: Content-type Header: Content-type:text/plain Output: Content-type Header: Content-type:text/longertextsubtype Output: Content-type Header: Content-type: text/plain;charset=iso-8859-1 Output: Content-type: text/plain;charset=iso-8859-1 Header: Content-type: text/plain; charset=UTF-8 Output: Content-type: text/plain; charset=UTF-8 So if you don't explicitly set the charset, like in the last two tests, the output is wrong. A small patch that makes this right in most cases: # diff -u php-4.2.3RC2/main/SAPI.c.orig php-4.2.3RC2/main/SAPI.c --- php-4.2.3RC2/main/SAPI.c.orig Sat Jul 27 15:15:42 2002 +++ php-4.2.3RC2/main/SAPI.cWed Sep 4 19:07:50 2002 -261,11 +261,12 newtype = emalloc(newlen + 1); PHP_STRLCPY(newtype, *mimetype, newlen + 1, len); strlcat(newtype, ;charset=, newlen + 1); + strlcat(newtype, charset, newlen + 1); if (*mimetype != NULL) { efree(*mimetype); } *mimetype = newtype; - return newlen; + return newlen - 1; } return 0; } -461,7 +462,7 sapi_header.header = newheader; sapi_header.header_len = newlen - 1; colon_offset = strchr(newheader, ':'); - *colon_offset = '\0'; + /* *colon_offset = '\0'; */ efree(header_line); } The test script output after this patch has been applied: # ./php -c . -q header_test.php Header: Content-type: text/plain Output: Content-type: text/plain;charset=iso-8859-1 Header: Content-type: text/xml Output: Content-type: text/xml;charset=iso-8859-1 Header: Content-type: application/xml Output: Content-type: application/xml Header: Content-type:text/plain Output: Content-type: text/plain;charset=iso-8859- Header: Content-type:text/plain Output: Content-type: text/plain;charset=iso-8859- Header: Content-type:text/longertextsubtype Output: Content-type: text/longertextsubtype;charset=iso-8859- Header: Content-type: text/plain;charset=iso-8859-1 Output: Content-type: text/plain;charset=iso-8859-1 Header: Content-type: text/plain; charset=UTF-8 Output: Content-type: text/plain; charset=UTF-8 Only the cases without a space after the colon are still garbled. RFC 2616, section 4.2, says: The field value MAY be preceded by any amount of LWS, though a single SP is preferred. So people should be able to use header(Content-type:text/plain) as well, but I can't find the remaining bug. Any comments, please? Regards... Michael -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Segfault in 4.2.3RC2
On Mit Sep 04, 2002 at 09:3724 +0200, [EMAIL PROTECTED] wrote: On Wed, 4 Sep 2002, Martin Jansen wrote: The script to reproduce the segfault can be found at http://www.martinjansen.com/php/segfault-4.2.3RC2.txt. If you need more information (backtrace etc.), just ask. That link gives a four oh four to me... Sorry - please try again. -- - Martin Martin Jansen http://martinjansen.com/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Segfault in 4.2.3RC2
On Wed Sep 04, 2002 at 09:3027PM +0200, Martin Jansen wrote: Obviously PHP 4.2.3RC2 segfaults when using wordwrap() with the following configure options: If it helps you, attached you'll find the backtrace of the crash. -- - Martin Martin Jansen http://martinjansen.com/ #0 0x402c1af6 in chunk_alloc () from /lib/libc.so.6 #1 0x402c1814 in malloc () from /lib/libc.so.6 #2 0x80d45ec in _emalloc (size=43) at zend_alloc.c:165 #3 0x80e54ef in zend_hash_add_or_update (ht=0x8142ee8, arKey=0x818bd24 wrapped, nKeyLength=8, pData=0xbfffe354, nDataSize=4, pDest=0xbfffe368, flag=1) at zend_hash.c:260 #4 0x80f42ed in zend_fetch_var_address (opline=0x818a8c8, Ts=0xbfffe38c, type=1) at ./zend_execute.c:575 #5 0x80f6072 in execute (op_array=0x8186584) at ./zend_execute.c:1239 #6 0x80e22fe in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:812 #7 0x8063166 in php_execute_script (primary_file=0xb790) at main.c:1383 #8 0x8060d53 in main (argc=3, argv=0xb80c) at cgi_main.c:778 #9 0x4026cbaf in __libc_start_main () from /lib/libc.so.6 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP-DEV] Segfault in 4.2.3RC2
Hello , MM http://www.martinjansen.com/php/segfault-4.2.3RC2.txt works for me, MM and I can see the segfault with 4.2.3RC2, configured only with MM --enable-debug --disable-mbstring (on Linux). This crash for me to. PHP 4.2.3RC1, apache dso, linux Best regards, Andrew Sitnikov -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] GD broken ? compiler errors !
No doubt.. but then the stuff on the distribution didnt work in the first place. Thats why i hoped the cvs had a fix for those erros. I have had prior experinces wherein a few files in the distribtion sources wouldnt compile and I had to refresh them from the CVS. These were the errors in the original gd sources that were part of the 4.2.2 distribtion... php_gd.h:69: warning: static declaration for `gdImageColorResolve' follows non-static gd.c:92: conflicting types for `gdIOCtx' /somepath/gd-1.8.4/gd_io.h:18: previous declaration of `gdIOCtx' gd.c: In function `php_imagettftext_common': gd.c:2800: warning: passing arg 2 of `virtual_filepath' from incompatible pointer type Has anybody got GD working in 4.2.2 ? --Roshan -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:48 PM To: NAIK,ROSHAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DEV] GD broken ? compiler errors ! You just can't mix current CVS c sources witth current stable release. It would be like gambling. The GD module has new enhancements in it which aren't available in 4.2.2 so that won't work. Please first test with http://www.php.net/~zeev/php-4.2.3RC2.tar.gz or even better http://snaps.php.net/php4-latest.tar.bz2 and see if this isse has been fixed already. Any remaining errors should be reported via bugs.php.net (preferable against php4-latest). -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc In short, the window belongs to me. The document belongs to the web site designer. - Poster on opera.wishlist -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] GD broken ? compiler errors !
Your problem is that you have multiple versions of gd on your system. PHP is picking up a gd.h somewhere on the standard include path and then trying to build against a different version. Clean up your system and it should work just fine. -Rasmus On Wed, 4 Sep 2002, NAIK,ROSHAN (HP-Cupertino,ex1) wrote: No doubt.. but then the stuff on the distribution didnt work in the first place. Thats why i hoped the cvs had a fix for those erros. I have had prior experinces wherein a few files in the distribtion sources wouldnt compile and I had to refresh them from the CVS. These were the errors in the original gd sources that were part of the 4.2.2 distribtion... php_gd.h:69: warning: static declaration for `gdImageColorResolve' follows non-static gd.c:92: conflicting types for `gdIOCtx' /somepath/gd-1.8.4/gd_io.h:18: previous declaration of `gdIOCtx' gd.c: In function `php_imagettftext_common': gd.c:2800: warning: passing arg 2 of `virtual_filepath' from incompatible pointer type Has anybody got GD working in 4.2.2 ? --Roshan -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:48 PM To: NAIK,ROSHAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DEV] GD broken ? compiler errors ! You just can't mix current CVS c sources witth current stable release. It would be like gambling. The GD module has new enhancements in it which aren't available in 4.2.2 so that won't work. Please first test with http://www.php.net/~zeev/php-4.2.3RC2.tar.gz or even better http://snaps.php.net/php4-latest.tar.bz2 and see if this isse has been fixed already. Any remaining errors should be reported via bugs.php.net (preferable against php4-latest). -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc In short, the window belongs to me. The document belongs to the web site designer. - Poster on opera.wishlist -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] GD broken ? compiler errors !
gd.h in the GD library (v 1.8.4) distribution (www.boutell.com/gd) declares ... typedef struct gdIOCtx { ..blah blah... } gdIOCtx; Then ext/gd/gd.c also goes ahead and declares ... #ifdef USE_GD_IOCTX .. .. typedef struct gdIOCtx; .. .. #endif Perhaps the guard USE_GD_IOCTX should have been taking effect ...but it isnt. So the PHP declaration is clearly conflicting. Multiple versions of gd.h do not exist on my machine. I reconfirmed it by searching in all the -I directories passed to gcc during make (i.e while building ext/gd.c) I also did an exhaustive search on the machine !! There is only one gd.h. --Roshan -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 2:09 PM To: NAIK,ROSHAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: RE: [PHP-DEV] GD broken ? compiler errors ! Your problem is that you have multiple versions of gd on your system. PHP is picking up a gd.h somewhere on the standard include path and then trying to build against a different version. Clean up your system and it should work just fine. -Rasmus On Wed, 4 Sep 2002, NAIK,ROSHAN (HP-Cupertino,ex1) wrote: No doubt.. but then the stuff on the distribution didnt work in the first place. Thats why i hoped the cvs had a fix for those erros. I have had prior experinces wherein a few files in the distribtion sources wouldnt compile and I had to refresh them from the CVS. These were the errors in the original gd sources that were part of the 4.2.2 distribtion... php_gd.h:69: warning: static declaration for `gdImageColorResolve' follows non-static gd.c:92: conflicting types for `gdIOCtx' /somepath/gd-1.8.4/gd_io.h:18: previous declaration of `gdIOCtx' gd.c: In function `php_imagettftext_common': gd.c:2800: warning: passing arg 2 of `virtual_filepath' from incompatible pointer type Has anybody got GD working in 4.2.2 ? --Roshan -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:48 PM To: NAIK,ROSHAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DEV] GD broken ? compiler errors ! You just can't mix current CVS c sources witth current stable release. It would be like gambling. The GD module has new enhancements in it which aren't available in 4.2.2 so that won't work. Please first test with http://www.php.net/~zeev/php-4.2.3RC2.tar.gz or even better http://snaps.php.net/php4-latest.tar.bz2 and see if this isse has been fixed already. Any remaining errors should be reported via bugs.php.net (preferable against php4-latest). -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] GD broken ? compiler errors !
gd.h in the GD library (v 1.8.4) distribution (www.boutell.com/gd) declares ... typedef struct gdIOCtx { ..blah blah... } gdIOCtx; Then ext/gd/gd.c also goes ahead and declares ... #ifdef USE_GD_IOCTX .. .. typedef struct gdIOCtx; .. .. #endif Perhaps the guard USE_GD_IOCTX should have been taking effect ...but it isnt. So the PHP declaration is clearly conflicting. No, you are not reading the code right. The actual code says: #ifdef USE_GD_IOCTX #include gd_ctx.c #else #define gdImageCreateFromGdCtx NULL #define gdImageCreateFromGd2Ctx NULL #define gdImageCreateFromGd2partCtx NULL #define gdImageCreateFromGifCtx NULL #define gdImageCreateFromJpegCtxNULL #define gdImageCreateFromPngCtx NULL #define gdImageCreateFromWBMPCtxNULL typedef FILE gdIOCtx; #define CTX_PUTC(c, fp) fputc(c, fp) #endif Note the #else there. So the only way that PHP will do that typedef is if USE_GD_IOCTX is not set. And this will not be set based on this: #if HAVE_LIBGD15 /* it's = 1.5, i.e. has IOCtx */ #define USE_GD_IOCTX 1 #else #undef USE_GD_IOCTX #endif ie. if HAVE_LIBGD15 is set, we set it. And this symbol comes from this config.m4 rule: PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) That says that it will link against libgd and check for the gdImagePaletteCopy() function. If it sees this function in the library, it will define HAVE_LIBGD15. My prediction is still that you have multiple versions of libgd installed. Probably an old libgd 1.3 library floating around somewhere that is getting picked up on this configure link. locate libgd should prove interesting. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] UTF8 support for PCRE missing from win32
I've just discovered (the hard way, unfortunately) that the win32 build of PHP does not support the u (UTF-8) modifier for pcre patterns. This is an inconsistency with our default build under Unix, which always has this turned on when using our bundled library. Adding this support to win32 is as simple as adding SUPPORT_UTF8 to the preprocessor definitions for Function Modules | PCRE | Source Files No. 3 in all configurations of the php4dllts workspace/project. Now, my local copy of this stuff is a big mangled, so I can't produce a patch for this little tweak, but a slightly more pressing matter is that we should probably have this define added to the 4.2.3 RC so that this feature is portable across platforms! If you get a few moments to make this change Zeev, (or any other win32 developer with Karma and a handy checked-out branch), it would be greatly appreciated! --Wez. -- Wez Furlong The Brain Room Ltd. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] GD broken ? compiler errors !
On Wed, 4 Sep 2002, Rasmus Lerdorf wrote: Your problem is that you have multiple versions of gd on your system. PHP is picking up a gd.h somewhere on the standard include path and then trying to build against a different version. Clean up your system and it should work just fine. I don't know for sure...but I think we could fix this easily in 4.3.0 and the new build stuff. As the problem usually is that even if you point --with-gd=/some/path, and happen to have gd.h in e.g. /usr/include, the latter will be used instead. I've committed possible fix in CVS. So please try that. --Jani On Wed, 4 Sep 2002, NAIK,ROSHAN (HP-Cupertino,ex1) wrote: No doubt.. but then the stuff on the distribution didnt work in the first place. Thats why i hoped the cvs had a fix for those erros. I have had prior experinces wherein a few files in the distribtion sources wouldnt compile and I had to refresh them from the CVS. These were the errors in the original gd sources that were part of the 4.2.2 distribtion... php_gd.h:69: warning: static declaration for `gdImageColorResolve' follows non-static gd.c:92: conflicting types for `gdIOCtx' /somepath/gd-1.8.4/gd_io.h:18: previous declaration of `gdIOCtx' gd.c: In function `php_imagettftext_common': gd.c:2800: warning: passing arg 2 of `virtual_filepath' from incompatible pointer type Has anybody got GD working in 4.2.2 ? --Roshan -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:48 PM To: NAIK,ROSHAN (HP-Cupertino,ex1) Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DEV] GD broken ? compiler errors ! You just can't mix current CVS c sources witth current stable release. It would be like gambling. The GD module has new enhancements in it which aren't available in 4.2.2 so that won't work. Please first test with http://www.php.net/~zeev/php-4.2.3RC2.tar.gz or even better http://snaps.php.net/php4-latest.tar.bz2 and see if this isse has been fixed already. Any remaining errors should be reported via bugs.php.net (preferable against php4-latest). -- GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc In short, the window belongs to me. The document belongs to the web site designer. - Poster on opera.wishlist -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- - For Sale! - -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Segfault in 4.2.3RC2
The problem described here occurs both in 4.2.3RC2 4.3.0-dev. The attached patch is against 4.3.0-dev (HEAD) and as far as my testing shows addresses the problem. The source of the segfault is a buffer overflow that results when estimated number of times the separator will be inserted is less the then actual number. There is no 'true' way of checking the number of separators to be inserted, since this number will often depend on the data contained in the string itself. So, the solution is to add a check that will reallocate more memory if the initial estimate on the string size proves to be incorrect. Unless, there are better solutions as alternatives to the patch or any strong objections I'll commit this patch to both 4.2.3RC2 4.3.0-dev in the morning. Ilia P.S. The segv can be replicated by the attached php script (segfault-4.2.3RC2.txt) submitted by Martin Jansen. Index: string.c === RCS file: /repository/php4/ext/standard/string.c,v retrieving revision 1.286 diff -u -3 -p -r1.286 string.c --- string.c 25 Aug 2002 19:08:07 - 1.286 +++ string.c 5 Sep 2002 01:47:59 - -595,7 +595,7 PHP_FUNCTION(wordwrap) const char *text, *breakchar = \n; char *newtext; int textlen, breakcharlen = 1, newtextlen; - long current = 0, laststart = 0, lastspace = 0; + long current = 0, laststart = 0, lastspace = 0, mem_alloced = 0; long linelength = 75; zend_bool docut = 0; -646,6 +646,7 PHP_FUNCTION(wordwrap) newtextlen = textlen * (breakcharlen + 1) + 1; } newtext = emalloc(newtextlen); + mem_alloced = newtextlen; /* now keep track of the actual new text length */ newtextlen = 0; -657,6 +658,12 PHP_FUNCTION(wordwrap) if (text[current] == breakchar[0] current + breakcharlen textlen !strncmp(text+current, breakchar, breakcharlen)) { + +if ((newtextlen+current-laststart+breakcharlen) = mem_alloced) { + mem_alloced += textlen-current+((textlen-current)/linelength + 1) * breakcharlen + 1; + newtext = erealloc(newtext, mem_alloced); +} + memcpy(newtext+newtextlen, text+laststart, current-laststart+breakcharlen); newtextlen += current-laststart+breakcharlen; current += breakcharlen - 1; -666,6 +673,11 PHP_FUNCTION(wordwrap) * copy and insert a break, or just keep track of it */ else if (text[current] == ' ') { if (current - laststart = linelength) { + if ((newtextlen+current-laststart+breakcharlen) = mem_alloced) { + mem_alloced += textlen-current+((textlen-current)/linelength + 1) * breakcharlen + 1; + newtext = erealloc(newtext, mem_alloced); + } + memcpy(newtext+newtextlen, text+laststart, current-laststart); newtextlen += current - laststart; memcpy(newtext+newtextlen, breakchar, breakcharlen); -679,6 +691,11 PHP_FUNCTION(wordwrap) * copy and insert a break. */ else if (current - laststart = linelength docut laststart = lastspace) { +if ((newtextlen+current-laststart+breakcharlen) = mem_alloced) { + mem_alloced += textlen-current+((textlen-current)/linelength + 1) * breakcharlen + 1; + newtext = erealloc(newtext, mem_alloced); +} + memcpy(newtext+newtextlen, text+laststart, current-laststart); newtextlen += current - laststart; memcpy(newtext+newtextlen, breakchar, breakcharlen); -690,6 +707,10 PHP_FUNCTION(wordwrap) * up the laststart */ else if (current - laststart = linelength laststart lastspace) { +if ((newtextlen+lastspace-laststart+breakcharlen) = mem_alloced) { + mem_alloced += textlen-current+((textlen-current)/linelength + 1) * breakcharlen + 1; + newtext = erealloc(newtext, mem_alloced); +} memcpy(newtext+newtextlen, text+laststart, lastspace-laststart); newtextlen += lastspace - laststart; memcpy(newtext+newtextlen, breakchar, breakcharlen); -700,8 +721,15 PHP_FUNCTION(wordwrap) /* copy over any stragglers */ if (laststart != current) { + if ((newtextlen+current - laststart) = mem_alloced) { +mem_alloced += current-laststart+1; +newtext = erealloc(newtext, mem_alloced); + } + memcpy(newtext+newtextlen, text+laststart, current-laststart); newtextlen += current - laststart; + } else { + newtext = erealloc(newtext, newtextlen+1); } newtext[newtextlen] = '\0'; ?php $var = 'Unser Waldhof liegt inmitten der ursprünglichen Landschaft des Dreiländerecks Deutschland Luxemburg Belgien. Umgeben von Wäldern, Wiesen und Feldern sind unsere Ferienwohnungen ein idealer Ausgangspunkt für ausgedehnte Streifzüge durch eine intakte Natur. Wanderer und Naturfreunde können bei uns die wohltuende Ruhe einer ländlichen Region genießen. Kinder fühlen sich auf unserem Bauerhof besonders wohl, denn hier können sie den artgerechten Umgang mit unseren Kühen und Kälbern, den Hühnern und Katzen, unseren beiden Ponys Max Moritz sowie unserem Hofhund Sanny
[PHP-DEV] Loading PHP extension
Hi I am developing a web site using PHP. We are using .so file for calling function built with c++. Its compiling properly but when putted in /usr/lib/php4 and run from PHP page it shows .. INVALID PHP Library I have PHP 4.0.0 In other server, we have PHP 4.1.2 in which its showing a diiferent warning. ie Dynamic library cannot be loaded in SAFE MODE I have set Safe Mode = Off in php.ini and restarted Apache (ie httpd) but still showing the same error... CAN anyone help.. ITS URGET!! bye ravi