[PHP-DEV] Pass by reference
Hi, this article http://phplens.com/lens/php-book/optimizing-debugging-php.php reads that pass-by-reference is slower than ordinary pass. Is it true? [snip] This is because (a) passing by reference is slower in PHP (this is probably not intuitive to C programmers, but the Zend Engine has been tuned this way) [/snip] Thanks Andrey Hristov -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
Hi, Running the following xml library packages: [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.1 Xml parser library for GNOME libxml2-2.4.12 Xml parser library for GNOME [10:33:08][root@insomniac]:/usr/local/php-4.2.2$ I have no problem with the following configure line: ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom --enable-trans-sid -enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --withfreetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --enable-pcntl Problems only arise upon make (this is just the part that died): [10:29:34][root@insomniac]:/usr/local/php-4.2.2$ make Making all in Zend Making all in main Making all in ext Making all in zlib Making all in ctype Making all in curl Making all in domxml gcc -I. -I/usr/local/php-4.2.2/ext/domxml -I/usr/local/php-4.2.2/main -I/usr/local/php-4.2.2 -I/usr/local/php-4.2.2/Zend -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local//include/freetype2/freetype -I/usr/local//include -I/usr/local//include/mysql -I/usr/local/include/pgsql -I/usr/local/php-4.2.2/ext/xml/expat -I/usr/local/php-4.2.2/TSRM -g -O2 -c php_domxml.c touch php_domxml.lo php_domxml.c: In function `zif_domxml_doc_get_element_by_id': php_domxml.c:2675: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_domxml_doc_ids': php_domxml.c:3292: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_xmldoc': php_domxml.c:3309: `xmlDoValidityCheckingDefaultValue' undeclared (first use in this function) php_domxml.c:3309: (Each undeclared identifier is reported only once php_domxml.c:3309: for each function it appears in.) php_domxml.c:3325: `xmlLoadExtDtdDefaultValue' undeclared (first use in this function) *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext. *** Error code 1 Stop in /usr/local/php-4.2.2. [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ Is there any more information I can give to help find a patch for this... or is it something Im doing wrong? I would really like to upgrade to 4.2.2 due to the security vunerability (and due to the nature of the applications running on this live server - post cannot be turned off). Alternative suggestions (and even hints as to how I could find the source of the problem and fix it myself would be welcomed - I have limited, but basic foundation in C programming). Thanks -- 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] Broken php_domxml.c on make in v4.2.2 (Im guessing)
Hello, upgrade libxml2 to atleast 2.4.14 and it should work again. Derick On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, Running the following xml library packages: [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.1 Xml parser library for GNOME libxml2-2.4.12 Xml parser library for GNOME [10:33:08][root@insomniac]:/usr/local/php-4.2.2$ I have no problem with the following configure line: ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom --enable-trans-sid -enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --withfreetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --enable-pcntl Problems only arise upon make (this is just the part that died): [10:29:34][root@insomniac]:/usr/local/php-4.2.2$ make Making all in Zend Making all in main Making all in ext Making all in zlib Making all in ctype Making all in curl Making all in domxml gcc -I. -I/usr/local/php-4.2.2/ext/domxml -I/usr/local/php-4.2.2/main -I/usr/local/php-4.2.2 -I/usr/local/php-4.2.2/Zend -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local//include/freetype2/freetype -I/usr/local//include -I/usr/local//include/mysql -I/usr/local/include/pgsql -I/usr/local/php-4.2.2/ext/xml/expat -I/usr/local/php-4.2.2/TSRM -g -O2 -c php_domxml.c touch php_domxml.lo php_domxml.c: In function `zif_domxml_doc_get_element_by_id': php_domxml.c:2675: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_domxml_doc_ids': php_domxml.c:3292: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_xmldoc': php_domxml.c:3309: `xmlDoValidityCheckingDefaultValue' undeclared (first use in this function) php_domxml.c:3309: (Each undeclared identifier is reported only once php_domxml.c:3309: for each function it appears in.) php_domxml.c:3325: `xmlLoadExtDtdDefaultValue' undeclared (first use in this function) *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext. *** Error code 1 Stop in /usr/local/php-4.2.2. [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ Is there any more information I can give to help find a patch for this... or is it something Im doing wrong? I would really like to upgrade to 4.2.2 due to the security vunerability (and due to the nature of the applications running on this live server - post cannot be turned off). Alternative suggestions (and even hints as to how I could find the source of the problem and fix it myself would be welcomed - I have limited, but basic foundation in C programming). Thanks -- 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 --- 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-DEV] CVS Account Request: dima
I want to help translate the Hebrew documentation -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: itay
for helping in translating php to hebrew -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
Hi, That worked for one machine, but this machine is still giving me jip. Configure line exactly the same, error exactly the same - but pkg_info different (uninstall / installed versions of libxml). [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.23 Xml parser library for GNOME [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ Please note that on the machine that worked, I have lib2-2.4.21 installed - would this make much difference? Thanks, - Dan Hello, upgrade libxml2 to atleast 2.4.14 and it should work again. Derick On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, Running the following xml library packages: [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.1 Xml parser library for GNOME libxml2-2.4.12 Xml parser library for GNOME [10:33:08][root@insomniac]:/usr/local/php-4.2.2$ I have no problem with the following configure line: ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom --enable-trans-sid -enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --withfreetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --enable-pcntl Problems only arise upon make (this is just the part that died): [10:29:34][root@insomniac]:/usr/local/php-4.2.2$ make Making all in Zend Making all in main Making all in ext Making all in zlib Making all in ctype Making all in curl Making all in domxml gcc -I. -I/usr/local/php-4.2.2/ext/domxml -I/usr/local/php-4.2.2/main -I/usr/local/php-4.2.2 -I/usr/local/php-4.2.2/Zend -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local//include/freetype2/freetype -I/usr/local//include -I/usr/local//include/mysql -I/usr/local/include/pgsql -I/usr/local/php-4.2.2/ext/xml/expat -I/usr/local/php-4.2.2/TSRM -g -O2 -c php_domxml.c touch php_domxml.lo php_domxml.c: In function `zif_domxml_doc_get_element_by_id': php_domxml.c:2675: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_domxml_doc_ids': php_domxml.c:3292: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_xmldoc': php_domxml.c:3309: `xmlDoValidityCheckingDefaultValue' undeclared (first use in this function) php_domxml.c:3309: (Each undeclared identifier is reported only once php_domxml.c:3309: for each function it appears in.) php_domxml.c:3325: `xmlLoadExtDtdDefaultValue' undeclared (first use in this function) *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext. *** Error code 1 Stop in /usr/local/php-4.2.2. [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ Is there any more information I can give to help find a patch for this... or is it something Im doing wrong? I would really like to upgrade to 4.2.2 due to the security vunerability (and due to the nature of the applications running on this live server - post cannot be turned off). Alternative suggestions (and even hints as to how I could find the source of the problem and fix it myself would be welcomed - I have limited, but basic foundation in C programming). Thanks -- 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 --- 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 --- -- 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: Pass by reference
Yes, see bug #14237 http://bugs.php.net/bug.php?id=14237 or http://phpxpath.sourceforge.net/benchmark/phpBench.php Regards, Steve -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Access to incomplete object should not be a fatal error
It seems accessing incoplete object became fatal error. Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition auth of the object you are trying to operate on was loaded _before_ the session was started in This breaks my session data manager and makes the manager unusable. I'm listing incomplete object properties for administrative purpose. Any comments? -- Yasuo Ohgaki --- incomplete_class.c.~1.13.~ Wed Dec 12 00:30:32 2001 +++ incomplete_class.c Tue Jul 23 19:23:33 2002 -49,7 +49,7 efree(class_name); - php_error(E_ERROR, %s, buf); + php_error(E_WARNING, %s, buf); } /* }}} */ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Access to incomplete object should not be a fatalerror
On Tue, 23 Jul 2002, Yasuo Ohgaki wrote: It seems accessing incoplete object became fatal error. Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition auth of the object you are trying to operate on was loaded _before_ the session was started in This breaks my session data manager and makes the manager unusable. I'm listing incomplete object properties for administrative purpose. Any comments? Uhm... of course this should give you an E_ERROR, it's simply not possible to call a method of an object that's only a half baken one. This should stay an E_ERROR. 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] Broken php_domxml.c on make in v4.2.2 (Im guessing)
On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, That worked for one machine, but this machine is still giving me jip. Configure line exactly the same, error exactly the same - but pkg_info different (uninstall / installed versions of libxml). [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.23 Xml parser library for GNOME [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ Please note that on the machine that worked, I have lib2-2.4.21 installed - would this make much difference? If you have the same error-message, you maybe have the old library lying around somewhere. It works fine with 2.4.23 for me. Check if it really gets the correct header-files (in php 4.2.3, we will have a ./configure, which checks for the correct version..) chregu Thanks, - Dan Hello, upgrade libxml2 to atleast 2.4.14 and it should work again. Derick On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, Running the following xml library packages: [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.1 Xml parser library for GNOME libxml2-2.4.12 Xml parser library for GNOME [10:33:08][root@insomniac]:/usr/local/php-4.2.2$ I have no problem with the following configure line: ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom --enable-trans-sid -enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --withfreetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --enable-pcntl Problems only arise upon make (this is just the part that died): [10:29:34][root@insomniac]:/usr/local/php-4.2.2$ make Making all in Zend Making all in main Making all in ext Making all in zlib Making all in ctype Making all in curl Making all in domxml gcc -I. -I/usr/local/php-4.2.2/ext/domxml -I/usr/local/php-4.2.2/main -I/usr/local/php-4.2.2 -I/usr/local/php-4.2.2/Zend -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local//include/freetype2/freetype -I/usr/local//include -I/usr/local//include/mysql -I/usr/local/include/pgsql -I/usr/local/php-4.2.2/ext/xml/expat -I/usr/local/php-4.2.2/TSRM -g -O2 -c php_domxml.c touch php_domxml.lo php_domxml.c: In function `zif_domxml_doc_get_element_by_id': php_domxml.c:2675: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_domxml_doc_ids': php_domxml.c:3292: warning: passing arg 2 of `xmlHashScan' from incompatible pointer type php_domxml.c: In function `zif_xmldoc': php_domxml.c:3309: `xmlDoValidityCheckingDefaultValue' undeclared (first use in this function) php_domxml.c:3309: (Each undeclared identifier is reported only once php_domxml.c:3309: for each function it appears in.) php_domxml.c:3325: `xmlLoadExtDtdDefaultValue' undeclared (first use in this function) *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext/domxml. *** Error code 1 Stop in /usr/local/php-4.2.2/ext. *** Error code 1 Stop in /usr/local/php-4.2.2. [10:29:58][root@insomniac]:/usr/local/php-4.2.2$ Is there any more information I can give to help find a patch for this... or is it something Im doing wrong? I would really like to upgrade to 4.2.2 due to the security vunerability (and due to the nature of the applications running on this live server - post cannot be turned off). Alternative suggestions (and even hints as to how I could find the source of the problem and fix it myself would be welcomed - I have limited, but basic foundation in C programming). Thanks -- 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 --- 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 --- -- nam...christian stockeradr...bremgartnerstr. 66, ch-8003 zurich pho...+41 1 451 6021 www...http://phant.ch/chregu mob...+41 76 561 8860 [EMAIL PROTECTED] wor...+41 1 240 5670 gpg...0x5CE1DECB -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, That worked for one machine, but this machine is still giving me jip. Configure line exactly the same, error exactly the same - but pkg_info different (uninstall / installed versions of libxml). [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.23 Xml parser library for GNOME [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ Please note that on the machine that worked, I have lib2-2.4.21 installed - would this make much difference? If you have the same error-message, you maybe have the old library lying around somewhere. It works fine with 2.4.23 for me. Check if it really gets the correct header-files (in php 4.2.3, we will have a ./configure, which checks for the correct version..) chregu [11:41:22][root@insomniac]:/usr/local/lib$ ls -la | grep libxml2 -rw-r--r-- 1 root wheel 767658 Jul 23 10:54 libxml2.a -rwxr-xr-x 1 root wheel 645 Jul 19 2001 libxml2.la lrwxr-xr-x 1 root wheel 12 Jul 23 10:54 libxml2.so - libxml2.so.5 -rwxr-xr-x 1 root wheel 704631 Jul 23 10:54 libxml2.so.5 [11:41:22][root@insomniac]:/usr/local/lib$ The libxml2.la file is from libxml 2.4.11 and is now dormant (I believe)... but the file sizes seem to be about right - and seen as I updated libxml to 2.4.23 today it all seems present and correct. As regards to it getting the correct header files, all I could find from the configure output was: === checking for DOM support... yes checking for libxml version... = 2.4.2 === Am I looking in the right place? Is there a better way to find out which header files its refering to? Is there anyway I can check what version the libxml2.so is? Im not all that good at debugging applications like this - but Im willing to learn ;) Thanks for your help -- 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] Access to incomplete object should not be a fatal
[EMAIL PROTECTED] wrote: On Tue, 23 Jul 2002, Yasuo Ohgaki wrote: It seems accessing incoplete object became fatal error. Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition auth of the object you are trying to operate on was loaded _before_ the session was started in This breaks my session data manager and makes the manager unusable. I'm listing incomplete object properties for administrative purpose. Any comments? Uhm... of course this should give you an E_ERROR, it's simply not possible to call a method of an object that's only a half baken one. This should stay an E_ERROR. You must be too tired. Accessing object properties in session database, _NOT_ method. It should be able to access properties. Otherwise, users aren't able to write session data admin apps with PHP. It also possible users may have application intentionally using incomplete object because complete object is not needed for the page. Thus, current code may break these optimized scripts. Therefore, I think it may be ok with E_NOTICE instead of E_WARNING. Anyway, here is a patch to make is_object() return false for incomplete objects. Any comments? -- Yasuo Ohgaki ? incomplete_class.patch Index: incomplete_class.c === RCS file: /repository/php4/ext/standard/incomplete_class.c,v retrieving revision 1.13 diff -u -r1.13 incomplete_class.c --- incomplete_class.c 11 Dec 2001 15:30:32 - 1.13 +++ incomplete_class.c 23 Jul 2002 10:38:41 - @@ -30,8 +30,6 @@ you are trying to operate on was loaded _before_ \ the session was started -#define INCOMPLETE_CLASS __PHP_Incomplete_Class -#define MAGIC_MEMBER __PHP_Incomplete_Class_Name /* {{{ incomplete_class_message */ @@ -49,7 +47,7 @@ efree(class_name); - php_error(E_ERROR, %s, buf); + php_error(E_WARNING, %s, buf); } /* }}} */ Index: php_incomplete_class.h === RCS file: /repository/php4/ext/standard/php_incomplete_class.h,v retrieving revision 1.8 diff -u -r1.8 php_incomplete_class.h --- php_incomplete_class.h 11 Dec 2001 15:30:35 - 1.8 +++ php_incomplete_class.h 23 Jul 2002 10:38:41 - @@ -44,12 +44,13 @@ size_t name_len; \ zend_bool free_class_name = 0 \ - +#define INCOMPLETE_CLASS __PHP_Incomplete_Class +#define MAGIC_MEMBER __PHP_Incomplete_Class_Name #ifdef __cplusplus extern C { #endif - + zend_class_entry *php_create_incomplete_class(TSRMLS_D); char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del); Index: type.c === RCS file: /repository/php4/ext/standard/type.c,v retrieving revision 1.18 diff -u -r1.18 type.c --- type.c 8 Jul 2002 18:29:54 - 1.18 +++ type.c 23 Jul 2002 10:38:42 - @@ -19,6 +19,7 @@ /* $Id: type.c,v 1.18 2002/07/08 18:29:54 andi Exp $ */ #include php.h +#include php_incomplete_class.h /* {{{ proto string gettype(mixed var) Returns the type of the variable */ @@ -200,6 +201,13 @@ } if (Z_TYPE_PP(arg) == type) { + if (type == IS_OBJECT) { + zend_class_entry *ce; + ce = Z_OBJCE_PP(arg); + if (!strcmp(ce-name, INCOMPLETE_CLASS)) { + RETURN_FALSE; + } + } RETURN_TRUE; } else { RETURN_FALSE; -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Patch suggestions for PHP 4.2.3 (sablotron and pcre)
Hello, I have two patch suggestions for PHP 4.2.3. Both patches patch well into PHP 4.2.2. http://rpms.arvin.dk/php/source/patches/php-4.2.2-xslt-config.m4.patch -- First part of the patch removes the iconv detection which simply doesn't seem to work well; at least it didn't detect iconv built into glibc on my Red Hat 7.3 system. This may be a bit controversial. The second part of the patch is less controversial: Without the changes, detection of SablotSetEncoding fails on my system (I have sablotron with javascript enabled). http://rpms.arvin.dk/php/source/patches/php-4.2.2-pcre.config.m4.patch -- Without this patch, configure can't find pcre.h on my system (Red Hat 7.3) when pcre is compiled to use the system pcre library in stead of the bundled pcre library. -- Greetings from Troels Arvin, Copenhagen, Denmark -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Access to incomplete object should not be a fatal
[EMAIL PROTECTED] wrote: Uhm... of course this should give you an E_ERROR, it's simply not possible to call a method of an object that's only a half baken one. This should stay an E_ERROR. I agree. It should raise E_ERROR for method calls. Here is newer patch. Any comments. -- Yasuo Ohgaki ? incomplete_class.patch Index: incomplete_class.c === RCS file: /repository/php4/ext/standard/incomplete_class.c,v retrieving revision 1.13 diff -u -r1.13 incomplete_class.c --- incomplete_class.c 11 Dec 2001 15:30:32 - 1.13 +++ incomplete_class.c 23 Jul 2002 11:21:18 - @@ -30,12 +30,10 @@ you are trying to operate on was loaded _before_ \ the session was started -#define INCOMPLETE_CLASS __PHP_Incomplete_Class -#define MAGIC_MEMBER __PHP_Incomplete_Class_Name /* {{{ incomplete_class_message */ -static void incomplete_class_message(zend_property_reference *ref) +static void incomplete_class_message(zend_property_reference *ref, int error_type) { char buf[1024]; char *class_name; @@ -49,7 +47,7 @@ efree(class_name); - php_error(E_ERROR, %s, buf); + php_error(error_type, %s, buf); } /* }}} */ @@ -57,7 +55,7 @@ */ static void incomplete_class_call_func(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) { - incomplete_class_message(property_reference); + incomplete_class_message(property_reference, E_ERROR); } /* }}} */ @@ -65,7 +63,7 @@ */ static int incomplete_class_set_property(zend_property_reference *property_reference, zval *value) { - incomplete_class_message(property_reference); + incomplete_class_message(property_reference, E_NOTICE); /* does not reach this point */ return (0); @@ -78,7 +76,7 @@ { zval foo; - incomplete_class_message(property_reference); + incomplete_class_message(property_reference, E_NOTICE); /* does not reach this point */ memset(foo, 0, sizeof(zval)); /* shut warnings up */ Index: php_incomplete_class.h === RCS file: /repository/php4/ext/standard/php_incomplete_class.h,v retrieving revision 1.8 diff -u -r1.8 php_incomplete_class.h --- php_incomplete_class.h 11 Dec 2001 15:30:35 - 1.8 +++ php_incomplete_class.h 23 Jul 2002 11:21:18 - @@ -44,12 +44,13 @@ size_t name_len; \ zend_bool free_class_name = 0 \ - +#define INCOMPLETE_CLASS __PHP_Incomplete_Class +#define MAGIC_MEMBER __PHP_Incomplete_Class_Name #ifdef __cplusplus extern C { #endif - + zend_class_entry *php_create_incomplete_class(TSRMLS_D); char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del); Index: type.c === RCS file: /repository/php4/ext/standard/type.c,v retrieving revision 1.18 diff -u -r1.18 type.c --- type.c 8 Jul 2002 18:29:54 - 1.18 +++ type.c 23 Jul 2002 11:21:18 - @@ -19,6 +19,7 @@ /* $Id: type.c,v 1.18 2002/07/08 18:29:54 andi Exp $ */ #include php.h +#include php_incomplete_class.h /* {{{ proto string gettype(mixed var) Returns the type of the variable */ @@ -200,6 +201,13 @@ } if (Z_TYPE_PP(arg) == type) { + if (type == IS_OBJECT) { + zend_class_entry *ce; + ce = Z_OBJCE_PP(arg); + if (!strcmp(ce-name, INCOMPLETE_CLASS)) { + RETURN_FALSE; + } + } RETURN_TRUE; } else { RETURN_FALSE; -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] W3C html validation issue
Zitat von Jani Taskinen [EMAIL PROTECTED]: You're only supposed to change it in your HTML..NOT in the browser's query line.. As well as in header() calls (as already stated in this thread) and in javascript calls: document.location.href = 'foo.php?bar=1amp;var=2' won't work either. On 22 Jul 2002, Walter A. Boring IV wrote: Howdy, This may be a tad off topic, but it is related to how php deals with building the $_GET superglobal w/ query string vars. According to the W3C HTML validator, it is illegal to build a query string for a url such as foo.php?bar=1myvar=2 They say you HAVE to use foo.php?bar=1amp;myvar=2 in php's case it builds $_GET[bar] = 1; $_GET[amp;myvar] = 2; I don't know of ANYONE on the planet that builds query string vars in this way. Unless you do, your html pages will not validate through the W3C validator. The official W3c spec explanation is at http://www.htmlhelp.com/tools/validator/problems.html#amp I think changing this could potentially break many sites. Does anyone know what other web languages do with amp;myvar=2 ? I think the W3C validator is broken/wrong in this respect, and wanted to know what other folks think about it. Jan. -- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] W3C html validation issue
You're only supposed to change it in your HTML..NOT in the browser's query line.. As well as in header() calls (as already stated in this thread) and in javascript calls: document.location.href = 'foo.php?bar=1amp;var=2' won't work either. Guys, the W3C recommended separator for GET parameters is the semicolon. mk -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: akcakayaa
To help translating PHP Documentation -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] New OpenSSL fuctions
Added: New functions for certificate signed requests: openssl_csr_file_verify openssl_csr_verify openssl_csr_parse openssl_csr_get_public Changed: openssl_pkcs7_verify to accept DER and PEM formats. -- Regards, Arkadiusz Gralski: [EMAIL PROTECTED] diff -Nu --recursive php-4.2.2/ext/openssl/openssl.c php-4.2.2-new/ext/openssl/openssl.c --- php-4.2.2/ext/openssl/openssl.c Wed May 1 10:22:56 2002 +++ php-4.2.2-new/ext/openssl/openssl.c Tue Jul 23 08:44:38 2002 @@ -15,6 +15,8 @@ | Authors: Stig Venaas [EMAIL PROTECTED]| | Wez Furlong [EMAIL PROTECTED] | | Sascha Kettler [EMAIL PROTECTED]| + | Additional programming: | + | Norbert Mocek [EMAIL PROTECTED] | +--+ */ @@ -39,12 +41,16 @@ #include openssl/pem.h #include openssl/err.h #include openssl/conf.h -#include openssl/e_os.h +#include openssl/e_os2.h #include openssl/rand.h #define DEFAULT_KEY_LENGTH 512 #define MIN_KEY_LENGTH 384 +#define FORMAT_UNDEF0 +#define FORMAT_ASN1 1 +#define FORMAT_PEM 3 +#define FORMAT_SMIME6 #define DEBUG_SMIME 0 @@ -89,6 +95,10 @@ PHP_FE(openssl_csr_export, arg2_force_ref) PHP_FE(openssl_csr_export_to_file, NULL) PHP_FE(openssl_csr_sign, NULL) + PHP_FE(openssl_csr_parse, NULL) + PHP_FE(openssl_csr_file_verify, NULL) + PHP_FE(openssl_csr_verify, NULL) + PHP_FE(openssl_csr_get_public, NULL) PHP_FE(openssl_sign, arg2_force_ref) @@ -109,6 +119,7 @@ PHP_FE(openssl_error_string, NULL) {NULL, NULL, NULL} + }; /* }}} */ @@ -545,6 +556,9 @@ REGISTER_LONG_CONSTANT(PKCS7_NOCERTS, PKCS7_NOCERTS, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PKCS7_NOATTR, PKCS7_NOATTR, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PKCS7_BINARY, PKCS7_BINARY, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(FORMAT_PEM, FORMAT_PEM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(FORMAT_SMIME, FORMAT_SMIME, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(FORMAT_DER, FORMAT_ASN1, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PKCS7_NOSIGS, PKCS7_NOSIGS, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(OPENSSL_PKCS1_PADDING, @@ -1579,6 +1593,247 @@ } /* }}} */ +/* {{{ proto bool openssl_csr_file_verify(string filename, long inform) + verifies the signature on the request in file*/ +PHP_FUNCTION(openssl_csr_file_verify) +{ + int x509=0; + BIO *in=NULL,*out=NULL; + EVP_PKEY *pkey=NULL; + int i,newreq=0; + int kludge=0; + int informat,verify=1,keyform=FORMAT_PEM; + char *infile; + long infile_len; + X509_REQ *req=NULL; + + RETVAL_LONG(-1); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sl, infile, infile_len, +informat) == FAILURE) + return; + + in=BIO_new(BIO_s_file()); + out=BIO_new(BIO_s_file()); + if ((in == NULL) || (out == NULL)) + goto end; + + if (!newreq) + { + /* Since we are using a pre-existing certificate + * request, the kludge 'format' info should not be + * changed. */ + kludge= -1; + if (infile == NULL) + BIO_set_fp(in,stdin,BIO_NOCLOSE); + else + { + if (BIO_read_filename(in,infile) = 0) +{ +perror(infile); +goto end; +} + } + + if (informat == FORMAT_ASN1) + req=d2i_X509_REQ_bio(in,NULL); + else if (informat == FORMAT_PEM) + req=PEM_read_bio_X509_REQ(in,NULL,NULL,NULL); + else + { + zend_error(E_WARNING, bad input format specified for X509 request\n); + RETVAL_LONG(-1); + goto end; + } + if (req == NULL) + { + zend_error(E_WARNING, unable to load X509 request\n); + RETVAL_LONG(-1); + goto end; + } + } + + if (verify !x509) + { + int tmp=0; + + if (pkey == NULL) + { + pkey=X509_REQ_get_pubkey(req); + tmp=1; + if (pkey == NULL) goto end; + } + + i=X509_REQ_verify(req,pkey); + if (tmp) { + EVP_PKEY_free(pkey); + pkey=NULL; + } + + if (i 0) + { + goto end; + } + else if (i == 0) + { + zend_error(E_WARNING, verify failure\n); + RETVAL_LONG(-1); + } + else /* if (i 0) */ + RETVAL_TRUE; + } + +end: + EVP_PKEY_free(pkey); + X509_REQ_free(req); +} +/* }}} */ + +/* {{{ proto bool openssl_csr_verify(mixed csr) + verifies the signature on the request*/ +PHP_FUNCTION(openssl_csr_verify) +{ + int x509=0; + zval * zcsr; + BIO *in=NULL,*out=NULL; + EVP_PKEY *pkey=NULL; + int i,newreq=0; + int kludge=0; + int informat,verify=1,keyform=FORMAT_PEM; + char *infile; + long infile_len; + X509_REQ *req=NULL; + long csr_resource = -1; + char *bio_mem_ptr; + long bio_mem_len; + + RETVAL_LONG(-1); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, zcsr) == FAILURE) + return; + + req = php_openssl_csr_from_zval(zcsr, 0, csr_resource TSRMLS_CC); + if (req == NULL) { + zend_error(E_WARNING, cannot get CSR from parameter 1); + return; + } + + + if (verify !x509) + { + int tmp=0; + + if (pkey ==
Re: [PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
On Tue, 23 Jul 2002, Dan Hardiker wrote: On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, That worked for one machine, but this machine is still giving me jip. Configure line exactly the same, error exactly the same - but pkg_info different (uninstall / installed versions of libxml). [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ pkg_info | grep xml libxml2-2.4.23 Xml parser library for GNOME [11:07:39][root@insomniac]:/usr/local/php-4.2.2$ Please note that on the machine that worked, I have lib2-2.4.21 installed - would this make much difference? If you have the same error-message, you maybe have the old library lying around somewhere. It works fine with 2.4.23 for me. Check if it really gets the correct header-files (in php 4.2.3, we will have a ./configure, which checks for the correct version..) chregu [11:41:22][root@insomniac]:/usr/local/lib$ ls -la | grep libxml2 -rw-r--r-- 1 root wheel 767658 Jul 23 10:54 libxml2.a -rwxr-xr-x 1 root wheel 645 Jul 19 2001 libxml2.la lrwxr-xr-x 1 root wheel 12 Jul 23 10:54 libxml2.so - libxml2.so.5 -rwxr-xr-x 1 root wheel 704631 Jul 23 10:54 libxml2.so.5 [11:41:22][root@insomniac]:/usr/local/lib$ The libxml2.la file is from libxml 2.4.11 and is now dormant (I believe)... but the file sizes seem to be about right - and seen as I updated libxml to 2.4.23 today it all seems present and correct. As regards to it getting the correct header files, all I could find from the configure output was: === checking for DOM support... yes checking for libxml version... = 2.4.2 === if you're not sure, you should ./configure with ---with-dom=/path/to/your/libxml/root/installation which is normaly either /usr/ or /usr/local/ you can also change the line #if LIBXML_VERSION = 20402 in configure to #if LIBXML_VERSION = 20414 and then it should really check for the right version and abort, if it didn't found the right one... HTH chregu -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
Hi, Still having major issues ... same error, same place, different .configure file (I edited it to read #if LIBXML_VERSION = 20414 instead), different configure line... same result. New Configure line (altered the --with-dom option): ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom=/usr/local/ --enable-trans-sid --enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --with-mhash=/usr/locl/ --with-freetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --with-apxs Configures fine, makes all the way up until the domxml extension and then dies miserably. BTW - Im running FreeBSD 4.6-STABLE if that makes a difference ... but the whole scenario works fine on another machine. I have the same packages installed in the same locations on a different machine, can I just copy the php4 apxs module across? (getting to a last resort) Alternative suggestions would be most welcome. Thanks, - Dan If you have the same error-message, you maybe have the old library lying around somewhere. It works fine with 2.4.23 for me. Check if it really gets the correct header-files (in php 4.2.3, we will have a ./configure, which checks for the correct version..) chregu [11:41:22][root@insomniac]:/usr/local/lib$ ls -la | grep libxml2 -rw-r--r-- 1 root wheel 767658 Jul 23 10:54 libxml2.a -rwxr-xr-x 1 root wheel 645 Jul 19 2001 libxml2.la lrwxr-xr-x 1 root wheel 12 Jul 23 10:54 libxml2.so - libxml2.so.5 -rwxr-xr-x 1 root wheel 704631 Jul 23 10:54 libxml2.so.5 [11:41:22][root@insomniac]:/usr/local/lib$ The libxml2.la file is from libxml 2.4.11 and is now dormant (I believe)... but the file sizes seem to be about right - and seen as I updated libxml to 2.4.23 today it all seems present and correct. As regards to it getting the correct header files, all I could find from the configure output was: === checking for DOM support... yes checking for libxml version... = 2.4.2 === if you're not sure, you should ./configure with ---with-dom=/path/to/your/libxml/root/installation which is normaly either /usr/ or /usr/local/ you can also change the line #if LIBXML_VERSION = 20402 in configure to #if LIBXML_VERSION = 20414 and then it should really check for the right version and abort, if it didn't found the right one... HTH chregu -- 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: Pass by reference
If you do a search on this newsgroup, Andi Gutmans said this sometime ago, i believe to the author of Phorum. That's where i originally got the info in the article. Regards, John Andrey Hristov [EMAIL PROTECTED] wrote in message 009e01c2322c$110bc8d0$1601a8c0@nik">news:009e01c2322c$110bc8d0$1601a8c0@nik... Hi, this article http://phplens.com/lens/php-book/optimizing-debugging-php.php reads that pass-by-reference is slower than ordinary pass. Is it true? [snip] This is because (a) passing by reference is slower in PHP (this is probably not intuitive to C programmers, but the Zend Engine has been tuned this way) [/snip] Thanks Andrey Hristov -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Broken php_domxml.c on make in v4.2.2 (Im guessing)
On Tue, 23 Jul 2002, Dan Hardiker wrote: Hi, Still having major issues ... same error, same place, different .configure file (I edited it to read #if LIBXML_VERSION = 20414 instead), different configure line... same result. New Configure line (altered the --with-dom option): ./configure --with-mysql=/usr/local/ --with-pgsql --with-gd=/usr/local/ --with-openssl --with-curl --enable-ftp --with-dom=/usr/local/ --enable-trans-sid --enable-sockets --enable-wddx --with-zlib --with-mcrypt=/usr/local/ --with-mhash=/usr/locl/ --with-freetype --with-t1lib --with-ttf --with-freetype-dir=/usr/local/ --with-apxs Configures fine, makes all the way up until the domxml extension and then dies miserably. BTW - Im running FreeBSD 4.6-STABLE if that makes a difference ... but the whole scenario works fine on another machine. i have no idea about freeBSD (shame on me) Alternative suggestions would be most welcome. Thanks, search for libxml2/include/xmlversion.h (with locate or whatever). If you find two, then delete the older one (or move). The whole include dir if you only find one, look at the line #define LIBXML_VERSION_STRING 20423 if the version is less than 20414, you lost :) you should then reinstall libxml2 with include files. I have the same packages installed in the same locations on a different machine, can I just copy the php4 apxs module across? (getting to a last resort) mmh. libraries are normally dynamically linked... no idea if this works... chregu -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] libphp4.so, Sun Solaris 8, relocation error
Thomas Langås: Output from ldd: dilbert:/usr/src/web/php-4.2.2# ldd -d /local/apache/libexec/libphp4.so libdl.so.1 =/lib/libdl.so.1 libpam.so.1 = /lib/libpam.so.1 libxmlrpc.so.0 =/local/lib/libxmlrpc.so.0 libexpat.so.0 = /local/lib/libexpat.so.0 libpdf.so.1 = /local/lib/libpdf.so.1 libz.so.1 = /lib/libz.so.1 libsched.so.1 = /lib/libsched.so.1 libgen.so.1 = /lib/libgen.so.1 libsocket.so.1 =/lib/libsocket.so.1 libnsl.so.1 = /lib/libnsl.so.1 libmysqlclient.so.10 = /local/lib/mysql/libmysqlclient.so.10 libldap.so.2 = /local/lib/libldap.so.2 liblber.so.2 = /local/lib/liblber.so.2 libintl.so.1 = /lib/libintl.so.1 libt1.so.1 =/local/lib/libt1.so.1 libm.so.1 = /lib/libm.so.1 libxml2.so.2 = /local/lib/libxml2.so.2 libgdbm.so.2 = /local/lib/libgdbm.so.2 libcrypt_i.so.1 = /lib/libcrypt_i.so.1 libresolv.so.2 =/lib/libresolv.so.2 libclntsh.so.8.0 = /local/oracle/lib/libclntsh.so.8.0 libc.so.1 = /lib/libc.so.1 libmp.so.2 =/lib/libmp.so.2 libwtc8.so =/local/oracle/lib/libwtc8.so libaio.so.1 = /lib/libaio.so.1 /usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1 symbol not found: __floatdidf (/local/apache/libexec/libphp4.so) When I added LDFLAGS += -lgcc to the topdir-Makefile, this went away and everything seems to work now. Why isn't this included by default? -- Thomas -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Patch suggestions for PHP 4.2.3 (sablotron and pcre)
Hi, I applied your less controversial patch. I will apply it to 4.3.0-dev as well. Thanks, Edin - Original Message - From: Troels Arvin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 23, 2002 1:04 PM Subject: [PHP-DEV] Patch suggestions for PHP 4.2.3 (sablotron and pcre) Hello, I have two patch suggestions for PHP 4.2.3. Both patches patch well into PHP 4.2.2. http://rpms.arvin.dk/php/source/patches/php-4.2.2-xslt-config.m4.pat ch -- First part of the patch removes the iconv detection which simply doesn't seem to work well; at least it didn't detect iconv built into glibc on my Red Hat 7.3 system. This may be a bit controversial. The second part of the patch is less controversial: Without the changes, detection of SablotSetEncoding fails on my system (I have sablotron with javascript enabled). http://rpms.arvin.dk/php/source/patches/php-4.2.2-pcre.config.m4.pat ch -- Without this patch, configure can't find pcre.h on my system (Red Hat 7.3) when pcre is compiled to use the system pcre library in stead of the bundled pcre library. -- Greetings from Troels Arvin, Copenhagen, Denmark -- 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] Re: New OpenSSL fuctions
Thanks for your efforts, but could you please diff against the current CVS version? Instructions can be found in the source (see README.SUBMITTING-PATCH, or similar name!), and on php.net. Thanks! --Wez. On 07/23/02, Arkadiusz Góralski [EMAIL PROTECTED] wrote: Added: New functions for certificate signed requests: openssl_csr_file_verify openssl_csr_verify openssl_csr_parse openssl_csr_get_public Changed: openssl_pkcs7_verify to accept DER and PEM formats. -- Regards, Arkadiusz Góralski: [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: Pass by reference
Thanks Info from year 2000 is available here : http://www.zend.com/zend/art/ref-count.php Regards, Andrey - Original Message - From: John Lim [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 23, 2002 3:28 PM Subject: [PHP-DEV] Re: Pass by reference If you do a search on this newsgroup, Andi Gutmans said this sometime ago, i believe to the author of Phorum. That's where i originally got the info in the article. Regards, John Andrey Hristov [EMAIL PROTECTED] wrote in message 009e01c2322c$110bc8d0$1601a8c0@nik">news:009e01c2322c$110bc8d0$1601a8c0@nik... Hi, this article http://phplens.com/lens/php-book/optimizing-debugging-php.php reads that pass-by-reference is slower than ordinary pass. Is it true? [snip] This is because (a) passing by reference is slower in PHP (this is probably not intuitive to C programmers, but the Zend Engine has been tuned this way) [/snip] Thanks Andrey Hristov -- 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] Fw: [ANNOUNCE] PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and4.2.1
Hi, I am not an expert in php but i would like to know how is the vulnerability exploited. hope to get the right directions regards anil PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and 4.2.1 Issued on: July 22, 2002 Software: PHP versions 4.2.0 and 4.2.1 Platforms: All The PHP Group has learned of a serious security vulnerability in PHP versions 4.2.0 and 4.2.1. An intruder may be able to execute arbitrary code with the privileges of the web server. This vulnerability may be exploited to compromise the web server and, under certain conditions, to gain privileged access. Description PHP contains code for intelligently parsing the headers of HTTP POST requests. The code is used to differentiate between variables and files sent by the user agent in a multipart/form-data request. This parser has insufficient input checking, leading to the vulnerability. The vulnerability is exploitable by anyone who can send HTTP POST requests to an affected web server. Both local and remote users, even from behind firewalls, may be able to gain privileged access. Impact Both local and remote users may exploit this vulnerability to compromise the web server and, under certain conditions, to gain privileged access. So far only the IA32 platform has been verified to be safe from the execution of arbitrary code. The vulnerability can still be used on IA32 to crash PHP and, in most cases, the web server. Solution The PHP Group has released a new PHP version, 4.2.2, which incorporates a fix for the vulnerability. All users of affected PHP versions are encouraged to upgrade to this latest version. The downloads web site at http://www.php.net/downloads.php has the new 4.2.2 source tarballs, Windows binaries and source patches from 4.2.0 and 4.2.1 available for download. Workaround If the PHP applications on an affected web server do not rely on HTTP POST input from user agents, it is often possible to deny POST requests on the web server. In the Apache web server, for example, this is possible with the following code included in the main configuration file or a top-level .htaccess file: Limit POST Order deny,allow Deny from all /Limit Note that an existing configuration and/or .htaccess file may have parameters contradicting the example given above. Credits The PHP Group would like to thank Stefan Esser of e-matters GmbH for discovering this vulnerability. Copyright (c) 2002 The PHP Group. -- PHP Announcements 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] Fw: [ANNOUNCE] PHP Security Advisory: Vulnerabilityin PHP versions 4.2.0 and4.2.1
This isn't a hacking board, if you want to break the law, learn how to do it somewhere else. Adam Voigt [EMAIL PROTECTED] On Tue, 2002-07-23 at 10:49, Anil Garg wrote: Hi, I am not an expert in php but i would like to know how is the vulnerability exploited. hope to get the right directions regards anil PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and 4.2.1 Issued on: July 22, 2002 Software: PHP versions 4.2.0 and 4.2.1 Platforms: All The PHP Group has learned of a serious security vulnerability in PHP versions 4.2.0 and 4.2.1. An intruder may be able to execute arbitrary code with the privileges of the web server. This vulnerability may be exploited to compromise the web server and, under certain conditions, to gain privileged access. Description PHP contains code for intelligently parsing the headers of HTTP POST requests. The code is used to differentiate between variables and files sent by the user agent in a multipart/form-data request. This parser has insufficient input checking, leading to the vulnerability. The vulnerability is exploitable by anyone who can send HTTP POST requests to an affected web server. Both local and remote users, even from behind firewalls, may be able to gain privileged access. Impact Both local and remote users may exploit this vulnerability to compromise the web server and, under certain conditions, to gain privileged access. So far only the IA32 platform has been verified to be safe from the execution of arbitrary code. The vulnerability can still be used on IA32 to crash PHP and, in most cases, the web server. Solution The PHP Group has released a new PHP version, 4.2.2, which incorporates a fix for the vulnerability. All users of affected PHP versions are encouraged to upgrade to this latest version. The downloads web site at http://www.php.net/downloads.php has the new 4.2.2 source tarballs, Windows binaries and source patches from 4.2.0 and 4.2.1 available for download. Workaround If the PHP applications on an affected web server do not rely on HTTP POST input from user agents, it is often possible to deny POST requests on the web server. In the Apache web server, for example, this is possible with the following code included in the main configuration file or a top-level .htaccess file: Limit POST Order deny,allow Deny from all /Limit Note that an existing configuration and/or .htaccess file may have parameters contradicting the example given above. Credits The PHP Group would like to thank Stefan Esser of e-matters GmbH for discovering this vulnerability. Copyright (c) 2002 The PHP Group. -- PHP Announcements 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 Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: thomasgm
I want a CVS account because i want to translate de PHP manual to the portuguese language, if you can create this account for me. Thank you :) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: New OpenSSL fuctions
On Tuesday 23 July 2002 14:39, Wez Furlong wrote: Thanks for your efforts, but could you please diff against the current CVS version? Here's the patch against CVS version. -- Regards, Arkadiusz Góralski: [EMAIL PROTECTED] diff -Nu --recursive php4/ext/openssl/openssl.c php4-new/ext/openssl/openssl.c --- php4/ext/openssl/openssl.c Fri Jul 12 23:46:34 2002 +++ php4-new/ext/openssl/openssl.c Tue Jul 23 17:14:26 2002 @@ -15,6 +15,8 @@ | Authors: Stig Venaas [EMAIL PROTECTED]| | Wez Furlong [EMAIL PROTECTED] | | Sascha Kettler [EMAIL PROTECTED]| + | Adding programming: | + | Norbert Mocek [EMAIL PROTECTED] | +--+ */ @@ -41,6 +43,11 @@ #include openssl/conf.h #include openssl/rand.h +#define FORMAT_UNDEF0 +#define FORMAT_ASN1 1 +#define FORMAT_PEM 3 +#define FORMAT_SMIME6 + #define DEFAULT_KEY_LENGTH 512 #define MIN_KEY_LENGTH 384 @@ -88,6 +95,10 @@ PHP_FE(openssl_csr_export, arg2_force_ref) PHP_FE(openssl_csr_export_to_file, NULL) PHP_FE(openssl_csr_sign, NULL) +PHP_FE(openssl_csr_parse, NULL) +PHP_FE(openssl_csr_file_verify, NULL) +PHP_FE(openssl_csr_verify,NULL) +PHP_FE(openssl_csr_get_public,NULL) PHP_FE(openssl_sign, arg2_force_ref) @@ -547,6 +558,9 @@ REGISTER_LONG_CONSTANT(PKCS7_NOATTR, PKCS7_NOATTR, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PKCS7_BINARY, PKCS7_BINARY, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PKCS7_NOSIGS, PKCS7_NOSIGS, CONST_CS|CONST_PERSISTENT); +REGISTER_LONG_CONSTANT(FORMAT_PEM, FORMAT_PEM, CONST_CS|CONST_PERSISTENT); +REGISTER_LONG_CONSTANT(FORMAT_SMIME, FORMAT_SMIME, CONST_CS|CONST_PERSISTENT); +REGISTER_LONG_CONSTANT(FORMAT_DER, FORMAT_ASN1, CONST_CS|CONST_PERSISTENT); REGISTER_LONG_CONSTANT(OPENSSL_PKCS1_PADDING, RSA_PKCS1_PADDING, @@ -1581,6 +1595,244 @@ PHP_SSL_REQ_DISPOSE(req); } /* }}} */ +/* {{{ proto bool openssl_csr_file_verify(string filename, long inform) + verifies the signature on the request in file*/ +PHP_FUNCTION(openssl_csr_file_verify) +{ + int x509=0; + BIO *in=NULL,*out=NULL; + EVP_PKEY *pkey=NULL; + int i,newreq=0; + int kludge=0; + int informat,verify=1,keyform=FORMAT_PEM; + char *infile; + long infile_len; + X509_REQ *req=NULL; + + RETVAL_LONG(-1); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sl, infile, infile_len, +informat) == FAILURE) + return; + + in=BIO_new(BIO_s_file()); + out=BIO_new(BIO_s_file()); + if ((in == NULL) || (out == NULL)) + goto end; + + if (!newreq) + { + /* Since we are using a pre-existing certificate + * request, the kludge 'format' info should not be + * changed. */ + kludge= -1; + if (infile == NULL) + BIO_set_fp(in,stdin,BIO_NOCLOSE); + else + { + if (BIO_read_filename(in,infile) = 0) +{ +perror(infile); +goto end; +} + } + + if (informat == FORMAT_ASN1) + req=d2i_X509_REQ_bio(in,NULL); + else if (informat == FORMAT_PEM) + req=PEM_read_bio_X509_REQ(in,NULL,NULL,NULL); + else + { + zend_error(E_WARNING, bad input format specified for X509 request\n); + RETVAL_LONG(-1); + goto end; + } + if (req == NULL) + { + zend_error(E_WARNING, unable to load X509 request\n); + RETVAL_LONG(-1); + goto end; + } + } + + if (verify !x509) + { + int tmp=0; + + if (pkey == NULL) + { + pkey=X509_REQ_get_pubkey(req); + tmp=1; + if (pkey == NULL) goto end; + } + + i=X509_REQ_verify(req,pkey); + if (tmp) { + EVP_PKEY_free(pkey); + pkey=NULL; + } + + if (i 0) + { + goto end; + } + else if (i == 0) + { + zend_error(E_WARNING, verify failure\n); + RETVAL_LONG(-1); + } + else /* if (i 0) */ + RETVAL_TRUE; + } + +end: + EVP_PKEY_free(pkey); + X509_REQ_free(req); +} +/* }}} */ + +/* {{{ proto bool openssl_csr_verify(mixed csr) + verifies the signature on the request*/ +PHP_FUNCTION(openssl_csr_verify) +{ + int x509=0; + zval * zcsr; + BIO *in=NULL,*out=NULL; + EVP_PKEY *pkey=NULL; + int i,newreq=0; + int kludge=0; + int informat,verify=1,keyform=FORMAT_PEM; + char *infile; + long infile_len; + X509_REQ *req=NULL; + long csr_resource = -1; + char *bio_mem_ptr; + long bio_mem_len; + + RETVAL_LONG(-1); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, zcsr) == FAILURE) + return; + + req = php_openssl_csr_from_zval(zcsr, 0, csr_resource TSRMLS_CC); + if (req == NULL) { + zend_error(E_WARNING, cannot get CSR from parameter 1); + return; + } + + + if (verify !x509) + { + int tmp=0; + + if (pkey == NULL) + { + pkey=X509_REQ_get_pubkey(req); + tmp=1; + if (pkey == NULL) goto end; + } + + i=X509_REQ_verify(req,pkey); + if (tmp)
Re: [PHP-DEV] libphp4.so, Sun Solaris 8, relocation error
It should be added now, try the latest CVS snapshot: http://snaps.php.net/php4-latest.tar.gz --Jani -- On Tue, 23 Jul 2002, Thomas Langås wrote: Thomas Langås: Output from ldd: dilbert:/usr/src/web/php-4.2.2# ldd -d /local/apache/libexec/libphp4.so libdl.so.1 =/lib/libdl.so.1 libpam.so.1 = /lib/libpam.so.1 libxmlrpc.so.0 =/local/lib/libxmlrpc.so.0 libexpat.so.0 = /local/lib/libexpat.so.0 libpdf.so.1 = /local/lib/libpdf.so.1 libz.so.1 = /lib/libz.so.1 libsched.so.1 = /lib/libsched.so.1 libgen.so.1 = /lib/libgen.so.1 libsocket.so.1 =/lib/libsocket.so.1 libnsl.so.1 = /lib/libnsl.so.1 libmysqlclient.so.10 = /local/lib/mysql/libmysqlclient.so.10 libldap.so.2 = /local/lib/libldap.so.2 liblber.so.2 = /local/lib/liblber.so.2 libintl.so.1 = /lib/libintl.so.1 libt1.so.1 =/local/lib/libt1.so.1 libm.so.1 = /lib/libm.so.1 libxml2.so.2 = /local/lib/libxml2.so.2 libgdbm.so.2 = /local/lib/libgdbm.so.2 libcrypt_i.so.1 = /lib/libcrypt_i.so.1 libresolv.so.2 =/lib/libresolv.so.2 libclntsh.so.8.0 = /local/oracle/lib/libclntsh.so.8.0 libc.so.1 = /lib/libc.so.1 libmp.so.2 =/lib/libmp.so.2 libwtc8.so =/local/oracle/lib/libwtc8.so libaio.so.1 = /lib/libaio.so.1 /usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1 symbol not found: __floatdidf (/local/apache/libexec/libphp4.so) When I added LDFLAGS += -lgcc to the topdir-Makefile, this went away and everything seems to work now. Why isn't this included by default? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] information request
In addition to database purposes it is used when you want to EVAL a string that may have embeded quotes. If they are not escaped the parser will barf (due to the magic nature of quote? or because they are a delimitor? This is one of the questions I am interrested in). If it was simply a matter of database needs it could be handled transparently by the database portion of the code and not be in the domain of the programmer. In fact different databases have different escape needs. (as http://www.php.net/manual/en/function.addslashes.php shows). There are many issues and needs concerning strings and that is why I am looking for a string guru for pointers to documentation or places to start. Thanks for your time and attention. Martin Rasmus Lerdorf wrote: Specifically I am interrested in variable interpolation and all the side effects of double quotes (I consider addslashes/stripslashes to be a kind of side effect as they are only necessary because of the magic of double quotes - as I understand it now. But then that is why I am asking for more information. There could be more to it.) No, addslashes/stripslases has to do with databases that want quotes escaped. They have nothing to do with PHP's internal string handling. -Rasmus -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: New OpenSSL fuctions
On Tue, 23 Jul 2002, Arkadiusz [utf-8] Góralski wrote: On Tuesday 23 July 2002 14:39, Wez Furlong wrote: Thanks for your efforts, but could you please diff against the current CVS version? Here's the patch against CVS version. The coding style in this patch is totally different then the rest of the PHP source, can you have a look at that? 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-DEV] CVS Account Request: juppie
I would like to translate the manual to Dutch... I was redirected by Derick Rethans. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] CVS Account Request: black
translating the manual to the slovene language occasional bug smashing/tracking | feature requests
[PHP-DEV] CVS Account Request: black
translating the manual to slovene, occasional bugfixes feature requests (reposting this trough the webform, since i didnt get it when subscribed on php-dev - ahem :)) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Newbie: ldap_connect() issue
I am working with PHP 4.1.2 on Redhat 7.3 using the version of PHP that shipped with the O/S. In version 7.1 of Redhat, I simply installed the default version of Apache and PHP and everything worked fine. On 7.3, I am having trouble getting connected to a known working LDAP directory. The error that I am receiving is: Call to undefined function: ldap_connect() From the line: $ds = ldap_connect(myldapservername); I have tried a variety of versions of the above line including the port number. Can someone point me in the right direction to help resolve the issue? Thanks in Advance -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] beginner question: how to execute unix command in PHP
Hi, I'm just starting to learn PHP. I couldn't find how to exec unix command and read the result. Basically, I just want to execute ls -lrt and read and display the output. This may be very simple question, but for some reason, I couldn't find any info on executing unix command from PHP. Thanks. -Paul -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] beginner question: how to execute unix command in PHP
i think you want the php-general list. this list is for developing PHP itself, not developing in PHP. dave -Original Message- From: Paul Oh [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 3:52 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] beginner question: how to execute unix command in PHP Hi, I'm just starting to learn PHP. I couldn't find how to exec unix command and read the result. Basically, I just want to execute ls -lrt and read and display the output. This may be very simple question, but for some reason, I couldn't find any info on executing unix command from PHP. Thanks. -Paul -- 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] beginner question: how to execute unix command in PHP
Hi, I'm just starting to learn PHP. I couldn't find how to exec unix command and read the result. Basically, I just want to execute ls -lrt and read and display the output. This may be very simple question, but for some reason, I couldn't find any info on executing unix command from PHP. Thanks. seriously, did you read the manual? php.net/exec php.net/system php.net/passthru or, simply put, perl style, $foo = `ls -lrt`; finally. please use [EMAIL PROTECTED] for these types of posts. -- James -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php