[PHP-DEV] Bug #15291 Updated: date() function time return problem
ID: 15291 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Date/time related Operating System: Debian PHP Version: 4.1.1 New Comment: I cannot replicate this. I think your timezone settings may be incorrect [swm@l php-4.1.1]$ ./php ? echo date('H'); ? 17[swm@l php-4.1.1]# date Wed Jan 30 17:51:27 EST 2002 [swm@l php-4.1.1]$ TZ=GMT ./php ? echo date('H'); ? 06[swm@l php-4.1.1]$ gavin Previous Comments: [2002-01-30 01:38:12] [EMAIL PROTECTED] The date() function is returning the value as GMT time. i.e this function and gmdate() produce the same result as of php 4.1.1. This was o.k in previous versions Edit this bug report at http://bugs.php.net/?id=15291edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15292 Updated: include() causes maxclients in apache.
ID: 15292 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Apache related Operating System: RedHat 7.1 PHP Version: 4.1.1 New Comment: Correct me I am wrong, but you seem to be saying that your script includes a file via HTTP which is either itself or another file which includes itself or the original (I cannot tell from your description). But yes, if a script needs to include itself than that will create an infinite loop. There is no way that the scripting engine could preemptively terminate this loop when HTTP based includes are being used. Reopen if I have mis-understood. Previous Comments: [2002-01-30 01:59:42] [EMAIL PROTECTED] ? $loca=http://www.bloodheart.com/php;; switch ($id) { //test1 case blank1: $file=$loca/blank1; break; //test2 case blank2: $file=$loca/blank2; break; //test (This is where the bug starts.) //Note if you copy this file to another file and set the default as thatfilename (with .php ext) // Then spawns maxclients for apache, and stays that way forever, a very nasy loop. or until you restart apache //*Example* //default: //$file=$loca/bug2.php; default: $file=$loca/blank3; break; } ? --CONFIGLINE ./configure --with-mysql=/usr/local/mysql \ --enable-track-vars \ --with-apache=../apache_1.3.22 \ --with-mm=../mm-1.1.3 \ --with-openssl=../openssl-0.9.6c \ --with-config-file-path=/usr/local/lib/php I don't recall this happening with an earlier version of php. This just started with 4.1.1 If you need anymore information please let me know Edit this bug report at http://bugs.php.net/?id=15292edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #15292 Updated: include() causes maxclients in apache.
ID: 15292 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Closed Status: Feedback Bug Type: Apache related Operating System: RedHat 7.1 PHP Version: 4.1.1 New Comment: Status should have been feedback. Previous Comments: [2002-01-30 02:10:12] [EMAIL PROTECTED] Correct me I am wrong, but you seem to be saying that your script includes a file via HTTP which is either itself or another file which includes itself or the original (I cannot tell from your description). But yes, if a script needs to include itself than that will create an infinite loop. There is no way that the scripting engine could preemptively terminate this loop when HTTP based includes are being used. Reopen if I have mis-understood. [2002-01-30 01:59:42] [EMAIL PROTECTED] ? $loca=http://www.bloodheart.com/php;; switch ($id) { //test1 case blank1: $file=$loca/blank1; break; //test2 case blank2: $file=$loca/blank2; break; //test (This is where the bug starts.) //Note if you copy this file to another file and set the default as thatfilename (with .php ext) // Then spawns maxclients for apache, and stays that way forever, a very nasy loop. or until you restart apache //*Example* //default: //$file=$loca/bug2.php; default: $file=$loca/blank3; break; } ? --CONFIGLINE ./configure --with-mysql=/usr/local/mysql \ --enable-track-vars \ --with-apache=../apache_1.3.22 \ --with-mm=../mm-1.1.3 \ --with-openssl=../openssl-0.9.6c \ --with-config-file-path=/usr/local/lib/php I don't recall this happening with an earlier version of php. This just started with 4.1.1 If you need anymore information please let me know Edit this bug report at http://bugs.php.net/?id=15292edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13490 Updated: Semaphores don't release automatically
ID: 13490 Updated by: swm Old Summary: Semaphores don't release automatically Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Semaphore related Operating System: FreeBSD 4.1.1 PHP Version: 4.0.6 New Comment: This is intended behaviour. This is how semaphores work. =) Use sem_remove() to remove semaphores. Previous Comments: [2001-09-28 19:03:32] [EMAIL PROTECTED] simplest script: ? $id = sem_get(0xff03e3); sem_acquire($id); ? modules: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-sockets' description: When i run that script for the first time, warning doesnt appear, as it is described in manual. All the other calls hang apache processes without any chance for semaphore to unlock. However, if i try such variant: ? set_time_limit(0); $id = sem_get(0xff03e3); sem_acquire($id); sleep(1); sem_release($id); ? everything works perfectly for single calls, but when I run my crash-test, which calls the php script 200 times at once, it hangs the semaphore again and many apache processes stay frozen. I think, the reason is incorrect request finalization. Edit this bug report at http://bugs.php.net/?id=13490edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #14849 Updated: str_replace() doesn't understand the '\t' escape sequence
ID: 14849 Updated by: swm Old Summary: str_replace() doesn't understand the '\t' escape sequence Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Strings related Operating System: FreeBSD PHP Version: 4.1.0 New Comment: Appears to be solved in current CVS: ? $content = thatthis; $content = str_replace(\t, , $content); echo $content; ? [swm@www test]$ ../php4/php -q t.php | od -c |less 000 t h a t t h i s 010 moreover: [swm@www test]$ ../php4/php -q t.php | od -c |less 000 t h a t t h i s 010 Closing. Reopen if you still have problems. Previous Comments: [2002-01-04 10:04:49] [EMAIL PROTECTED] $content = str_replace(\t, , $content); - doesn't do antything, ie str_replace() doesn't understand the '\t' escape character $content = str_replace(\x09, , $content); works fine however thanks for php! =) *hugs* Edit this bug report at http://bugs.php.net/?id=14849edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13490 Updated: Semaphores don't release automatically
ID: 13490 Updated by: swm Old Summary: Semaphores don't release automatically Reported By: [EMAIL PROTECTED] Old Status: Closed Status: Open Bug Type: Semaphore related Operating System: FreeBSD 4.1.1 PHP Version: 4.0.6 New Comment: My bad. Re-opened. Previous Comments: [2002-01-13 14:52:51] [EMAIL PROTECTED] http://www.php.net/manual/ru/function.sem-acquire.php: After processing a request, any semaphores acquired by the process but not explicitly released will be released automatically and a warning will be generated. Therefore, it is NOT intended behaviour, because in my situation semaphores DON'T release automatically. And any failure in php script causes apache to hang up in few seconds, because semaphore is acquired by dead script and all other instances can't work. This really is bug. :-( [2002-01-13 08:35:48] [EMAIL PROTECTED] This is intended behaviour. This is how semaphores work. =) Use sem_remove() to remove semaphores. [2001-09-28 19:03:32] [EMAIL PROTECTED] simplest script: ? $id = sem_get(0xff03e3); sem_acquire($id); ? modules: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-sockets' description: When i run that script for the first time, warning doesnt appear, as it is described in manual. All the other calls hang apache processes without any chance for semaphore to unlock. However, if i try such variant: ? set_time_limit(0); $id = sem_get(0xff03e3); sem_acquire($id); sleep(1); sem_release($id); ? everything works perfectly for single calls, but when I run my crash-test, which calls the php script 200 times at once, it hangs the semaphore again and many apache processes stay frozen. I think, the reason is incorrect request finalization. Edit this bug report at http://bugs.php.net/?id=13490edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10798 Updated: dba_open (mode c) problem
ID: 10798 Updated by: swm Old Summary: dba_open (mode c) problem Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: DBM/DBA related Operating System: Solaris 8 (Sparc) PHP Version: 4.0.5 New Comment: This is fixed in current CVS. Previous Comments: [2001-05-10 13:52:48] [EMAIL PROTECTED] ?php $db = dba_open(/tmp/test.db, c, db3); dba_insert (key, val, $db); dba_close($db); ? If the db-file does not exist, the db will be created and the scripts runs without problems. If teh db-file already exists I get: driver initialization failed... Configuration: apache-1.3.19 php-4.0.5 db3 3.2.9 ./configure\ --without-mysql\ --with-oci8 \ --with-oracle\ --with-imap\ --with-ldap\ --with-db3 \ --enable-sysvsem\ --enable-sysvshm\ --with-mm=/usr/local\ --enable-track-vars\ --enable-trans-sid\ --enable-shmop\ --with-gd \ --with-xpm-dir=/usr/local/lib \ --with-jpeg-dir=/usr/local/lib \ --enable-inline-optimization \ --enable-bcmath \ --with-gettext \ --with-mcal=/usr/local/mcal \ --with-mcrypt \ --disable-debug \ --with-apxs=/usr/local/apache/bin/apxs Edit this bug report at http://bugs.php.net/?id=10798edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10380 Updated: dba_*open with mode 'c' problem
ID: 10380 Updated by: swm Old Summary: dba_*open with mode 'c' problem Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: DBM/DBA related Operating System: RedHat 7.0 PHP Version: 4.0 Latest CVS (18/04/2001) New Comment: Fixed in current CVS Previous Comments: [2001-04-18 10:02:58] [EMAIL PROTECTED] db3 support compiled in without problems, all functions available and working. apache-1.3.19, php snapshot from today. db3 3.1.14-6, devel, utils, stock rpm install in rhl-7.0. database directory is drwxrwxrwt; using dba_open or dba_popen, with mode 'c', if the database doesn't exist, it is created and the function performs as expected. If the database already exists, the function should open the database for read/write access. Instead, it throws: driver initialization failed... despite having just created the database itself. For example: $dbpath = /usr/local/db3data/test/testdb3.db3; $dbmode = c; $dbhandler = db3; $dbh = dba_popen($dbpath,$dbmode,$dbhandler); $mykey = mykey; $myval = Hello World; if (!dba_exists($mykey,$dbh)) { echo Key doesn't exist, adding it.br\n; dba_insert ($mykey, $myval, $dbh); } else { $storedval = dba_fetch($mykey, $dbh); echo $storedval; } This snippet will work as expected if the database doesn't exist. If it does, the error occurs, where according to the docs it should just open the database for read write access. If the database exists and I change the mode to 'w', expected behaviour occurs. Edit this bug report at http://bugs.php.net/?id=10380edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11732 Updated: db3 driver initialization failed
ID: 11732 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Analyzed Bug Type: DBM/DBA related Operating System: RedHat 7.1 PHP Version: 4.0.6 New Comment: Fixed in current CVS. Previous Comments: [2001-06-27 22:18:01] [EMAIL PROTECTED] This example script works for me just fine with Berkeley DB 3.1.17 so there must be some differences between the 3.1.x and 3.2.x branches. [2001-06-27 07:17:42] [EMAIL PROTECTED] The Apache user has write perms on directory. script: if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); what is does, is just opening a file test.db, that has 0 bytes and causing the error Warning: driver initialization failed in /path/to/script.php opening already existant db3 files doesn't work either. changing the handler from db3 to db2 works fine configure line: ./configure --with-apxs=/usr/local/apache/current/bin/apxs --with-mysql=/usr/local/mysql/current --with-zlib --with-ftp --with-jpeg-dir=/usr/local/lib --enable-versioning --enable-track-vars=yes --enable-url-includes --enable-sysvshm=yes --enable-sysvsem=yes --with-config-file-path=/etc --with-db3=/usr/local/BerkeleyDB.3.2 --with-db2=/usr/include/db2 --with-sablot --enable-dbx i am using sleepycat's BerkeleyDB 3.2.9 hope, that's it Edit this bug report at http://bugs.php.net/?id=11732edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11732 Updated: db3 driver initialization failed
ID: 11732 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Analyzed Status: Closed Bug Type: DBM/DBA related Operating System: RedHat 7.1 PHP Version: 4.0.6 New Comment: Closed Previous Comments: [2002-01-12 02:27:32] [EMAIL PROTECTED] Fixed in current CVS. [2001-06-27 22:18:01] [EMAIL PROTECTED] This example script works for me just fine with Berkeley DB 3.1.17 so there must be some differences between the 3.1.x and 3.2.x branches. [2001-06-27 07:17:42] [EMAIL PROTECTED] The Apache user has write perms on directory. script: if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); what is does, is just opening a file test.db, that has 0 bytes and causing the error Warning: driver initialization failed in /path/to/script.php opening already existant db3 files doesn't work either. changing the handler from db3 to db2 works fine configure line: ./configure --with-apxs=/usr/local/apache/current/bin/apxs --with-mysql=/usr/local/mysql/current --with-zlib --with-ftp --with-jpeg-dir=/usr/local/lib --enable-versioning --enable-track-vars=yes --enable-url-includes --enable-sysvshm=yes --enable-sysvsem=yes --with-config-file-path=/etc --with-db3=/usr/local/BerkeleyDB.3.2 --with-db2=/usr/include/db2 --with-sablot --enable-dbx i am using sleepycat's BerkeleyDB 3.2.9 hope, that's it Edit this bug report at http://bugs.php.net/?id=11732edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13358 Updated: Berkeley DB3 and the DBA functions
ID: 13358 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: DBM/DBA related Operating System: RedHat 7.1 PHP Version: 4.0.6 New Comment: Fixed in current CVS. Previous Comments: [2001-09-21 13:32:42] [EMAIL PROTECTED] Just a couple of more points of information: 1) I have now tried compiling libphp4.so every which way. I have downloaded and installed from source db3.1.17, db3.2.9 and db3.3.11 - and have tried configuring --with-db3= (path to db3) with each of these different versions. No luck. 2) Again, I have no problem using the db3 driver and the dba functions with the stand alone binary of php that I configured --with-db3 Permissions are not a problem. 3) That link I gave to the phpinfo snapshot is gone. I am a dangerous sysadmin when logged in as root! But the dynamicly generated phpinfo() page is http://neaturl.com/phpinfo.php I've gone crazy over this. The only solutions I can see is to run the scripts that use dba functions on my db3 file as CGI. [2001-09-18 02:33:18] [EMAIL PROTECTED] Um. yeah, I am using BerkeleyDB3.1.17 which came rpm installed as part of the standard install. [2001-09-18 02:28:28] [EMAIL PROTECTED] I have noticed that a similar bug has been reported (Bug id #11732) - however I can report more details and I have another script with interesting results. First: the code that was provided in #11732 [code] ?php if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); ? [/code] [output] Warning: driver initialization failed in /usr/local/apache/htdocs/www-root/neaturl.com/temp/test.php on line 3 error [/output] But get this - test.db is created! The above code was called through from my browser (thus through the Apache web server) Here is a link to a snapshot of my php config at the time I ran that code: http://neaturl.com/temp/phpinfo-0109181613.html Now - here is the twist! If I call the same script (adding the path to the php binary) from bash, it runs fine! [code] #!/usr/local/bin/php ?php if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); ? [/code] [output] X-Powered-By: PHP/4.0.6 Content-type: text/html testval [/output] Actually, I came accross this problem because I had written a php script to initialize the postfix/virtual.db (which I ran from bash and had written a php script to read and output the key:value pairs (which again I ran OK from bash). But when I tried to run the same script by calling it from my browser - no cigar! Now I am assuming this is a bug. I would be delighted to learn that perhaps I have missed configuring something in php.ini Edit this bug report at http://bugs.php.net/?id=13358edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13629 Updated: DB3 fails (driver initialization failure)
ID: 13629 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: DBM/DBA related Operating System: Solaris 8 PHP Version: 4.0.6 New Comment: Fixed in current CVS. Previous Comments: [2001-10-10 15:40:30] [EMAIL PROTECTED] Er, just noticed the duplicity of the DBA_TRUNC code. Missed that the first time. ext/dba/dba_db3.c should change: type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : info-mode == DBA_CREAT ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; --Nathan [2001-10-10 15:36:52] [EMAIL PROTECTED] The following script runs fine the first time: ? $id = dba_open (testdb.db, c, db3); if (!$id) { echo dba_open failed\n; exit; } dba_close($id); ? But second time (after the DB is created) it fails. After a long day of research, I found the Berkley DB code changed: db-3.2.9/db/db.c: switch (type) { case DB_UNKNOWN: if (LF_ISSET(DB_CREATE|DB_TRUNCATE)) { __db_err(dbenv, %s: DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE, name); return (EINVAL); } ok_flags = 0; break; case DB_BTREE: ok_flags = DB_OK_BTREE; break; case DB_HASH: ok_flags = DB_OK_HASH; break; case DB_QUEUE: ok_flags = DB_OK_QUEUE; break; case DB_RECNO: ok_flags = DB_OK_RECNO; break; default: __db_err(dbenv, unknown type: %lu, (u_long)type); return (EINVAL); } When using c mode in dba_open, if the file does not exist, PHP calls dbp-open as: dbp-open(dbp, file, NULL, 1, 1, 420) When using c mode and the file does not exist, it calls dbp-open as: dbp-open(dbp, file, NULL, 5, 1, 420) DB_UNKNOWN and DB_CREATE are no longer valid options to pass together. My fix was to change ext/dba/dba_db3.c as follows: Before -- type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; After - type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : (VCWD_STAT(info-path, check_stat) || (info-mode == DBA_CREAT) || (info-mode == DBA_TRUNC)) ? DB_BTREE : DB_UNKNOWN; The only other way to solve this would be to attempt to determine the type of DB before trying to open it, as the PHP interface does not give the capability to distinguish between BTREE/RECNO/HASH/QUEUE/etc. This should solve the following bug reports: http://bugs.php.net/bug.php?id=10798 http://bugs.php.net/bug.php?id=13358 http://bugs.php.net/bug.php?id=8574 http://bugs.php.net/bug.php?id=11732 http://bugs.php.net/bug.php?id=10380 HTH, Nathan Clemons, Director of Virtual E-Services Network, Inc. Edit this bug report at http://bugs.php.net/?id=13629edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13358 Updated: Berkeley DB3 and the DBA functions
ID: 13358 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: DBM/DBA related Operating System: RedHat 7.1 PHP Version: 4.0.6 New Comment: closed Previous Comments: [2002-01-12 02:29:08] [EMAIL PROTECTED] Fixed in current CVS. [2001-09-21 13:32:42] [EMAIL PROTECTED] Just a couple of more points of information: 1) I have now tried compiling libphp4.so every which way. I have downloaded and installed from source db3.1.17, db3.2.9 and db3.3.11 - and have tried configuring --with-db3= (path to db3) with each of these different versions. No luck. 2) Again, I have no problem using the db3 driver and the dba functions with the stand alone binary of php that I configured --with-db3 Permissions are not a problem. 3) That link I gave to the phpinfo snapshot is gone. I am a dangerous sysadmin when logged in as root! But the dynamicly generated phpinfo() page is http://neaturl.com/phpinfo.php I've gone crazy over this. The only solutions I can see is to run the scripts that use dba functions on my db3 file as CGI. [2001-09-18 02:33:18] [EMAIL PROTECTED] Um. yeah, I am using BerkeleyDB3.1.17 which came rpm installed as part of the standard install. [2001-09-18 02:28:28] [EMAIL PROTECTED] I have noticed that a similar bug has been reported (Bug id #11732) - however I can report more details and I have another script with interesting results. First: the code that was provided in #11732 [code] ?php if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); ? [/code] [output] Warning: driver initialization failed in /usr/local/apache/htdocs/www-root/neaturl.com/temp/test.php on line 3 error [/output] But get this - test.db is created! The above code was called through from my browser (thus through the Apache web server) Here is a link to a snapshot of my php config at the time I ran that code: http://neaturl.com/temp/phpinfo-0109181613.html Now - here is the twist! If I call the same script (adding the path to the php binary) from bash, it runs fine! [code] #!/usr/local/bin/php ?php if(!$fp = dba_open(test.db, c, db3)) { print(error); exit; } dba_insert(testkey, testval, $fp); echo( dba_fetch(testkey, $fp)); dba_close($fp); ? [/code] [output] X-Powered-By: PHP/4.0.6 Content-type: text/html testval [/output] Actually, I came accross this problem because I had written a php script to initialize the postfix/virtual.db (which I ran from bash and had written a php script to read and output the key:value pairs (which again I ran OK from bash). But when I tried to run the same script by calling it from my browser - no cigar! Now I am assuming this is a bug. I would be delighted to learn that perhaps I have missed configuring something in php.ini Edit this bug report at http://bugs.php.net/?id=13358edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13629 Updated: DB3 fails (driver initialization failure)
ID: 13629 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: DBM/DBA related Operating System: Solaris 8 PHP Version: 4.0.6 New Comment: closed Previous Comments: [2002-01-12 02:30:10] [EMAIL PROTECTED] Fixed in current CVS. [2001-10-10 15:40:30] [EMAIL PROTECTED] Er, just noticed the duplicity of the DBA_TRUNC code. Missed that the first time. ext/dba/dba_db3.c should change: type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : info-mode == DBA_CREAT ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; --Nathan [2001-10-10 15:36:52] [EMAIL PROTECTED] The following script runs fine the first time: ? $id = dba_open (testdb.db, c, db3); if (!$id) { echo dba_open failed\n; exit; } dba_close($id); ? But second time (after the DB is created) it fails. After a long day of research, I found the Berkley DB code changed: db-3.2.9/db/db.c: switch (type) { case DB_UNKNOWN: if (LF_ISSET(DB_CREATE|DB_TRUNCATE)) { __db_err(dbenv, %s: DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE, name); return (EINVAL); } ok_flags = 0; break; case DB_BTREE: ok_flags = DB_OK_BTREE; break; case DB_HASH: ok_flags = DB_OK_HASH; break; case DB_QUEUE: ok_flags = DB_OK_QUEUE; break; case DB_RECNO: ok_flags = DB_OK_RECNO; break; default: __db_err(dbenv, unknown type: %lu, (u_long)type); return (EINVAL); } When using c mode in dba_open, if the file does not exist, PHP calls dbp-open as: dbp-open(dbp, file, NULL, 1, 1, 420) When using c mode and the file does not exist, it calls dbp-open as: dbp-open(dbp, file, NULL, 5, 1, 420) DB_UNKNOWN and DB_CREATE are no longer valid options to pass together. My fix was to change ext/dba/dba_db3.c as follows: Before -- type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; After - type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : (VCWD_STAT(info-path, check_stat) || (info-mode == DBA_CREAT) || (info-mode == DBA_TRUNC)) ? DB_BTREE : DB_UNKNOWN; The only other way to solve this would be to attempt to determine the type of DB before trying to open it, as the PHP interface does not give the capability to distinguish between BTREE/RECNO/HASH/QUEUE/etc. This should solve the following bug reports: http://bugs.php.net/bug.php?id=10798 http://bugs.php.net/bug.php?id=13358 http://bugs.php.net/bug.php?id=8574 http://bugs.php.net/bug.php?id=11732 http://bugs.php.net/bug.php?id=10380 HTH, Nathan Clemons, Director of Virtual E-Services Network, Inc. Edit this bug report at http://bugs.php.net/?id=13629edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13629 Updated: DB3 fails (driver initialization failure)
ID: 13629 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: DBM/DBA related Operating System: Solaris 8 PHP Version: 4.0.6 Previous Comments: [2002-01-12 02:30:10] [EMAIL PROTECTED] Fixed in current CVS. [2001-10-10 15:40:30] [EMAIL PROTECTED] Er, just noticed the duplicity of the DBA_TRUNC code. Missed that the first time. ext/dba/dba_db3.c should change: type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : info-mode == DBA_CREAT ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; --Nathan [2001-10-10 15:36:52] [EMAIL PROTECTED] The following script runs fine the first time: ? $id = dba_open (testdb.db, c, db3); if (!$id) { echo dba_open failed\n; exit; } dba_close($id); ? But second time (after the DB is created) it fails. After a long day of research, I found the Berkley DB code changed: db-3.2.9/db/db.c: switch (type) { case DB_UNKNOWN: if (LF_ISSET(DB_CREATE|DB_TRUNCATE)) { __db_err(dbenv, %s: DB_UNKNOWN type specified with DB_CREATE or DB_TRUNCATE, name); return (EINVAL); } ok_flags = 0; break; case DB_BTREE: ok_flags = DB_OK_BTREE; break; case DB_HASH: ok_flags = DB_OK_HASH; break; case DB_QUEUE: ok_flags = DB_OK_QUEUE; break; case DB_RECNO: ok_flags = DB_OK_RECNO; break; default: __db_err(dbenv, unknown type: %lu, (u_long)type); return (EINVAL); } When using c mode in dba_open, if the file does not exist, PHP calls dbp-open as: dbp-open(dbp, file, NULL, 1, 1, 420) When using c mode and the file does not exist, it calls dbp-open as: dbp-open(dbp, file, NULL, 5, 1, 420) DB_UNKNOWN and DB_CREATE are no longer valid options to pass together. My fix was to change ext/dba/dba_db3.c as follows: Before -- type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : VCWD_STAT(info-path, check_stat) ? DB_BTREE : DB_UNKNOWN; After - type = info-mode == DBA_READER ? DB_UNKNOWN : info-mode == DBA_TRUNC ? DB_BTREE : (VCWD_STAT(info-path, check_stat) || (info-mode == DBA_CREAT) || (info-mode == DBA_TRUNC)) ? DB_BTREE : DB_UNKNOWN; The only other way to solve this would be to attempt to determine the type of DB before trying to open it, as the PHP interface does not give the capability to distinguish between BTREE/RECNO/HASH/QUEUE/etc. This should solve the following bug reports: http://bugs.php.net/bug.php?id=10798 http://bugs.php.net/bug.php?id=13358 http://bugs.php.net/bug.php?id=8574 http://bugs.php.net/bug.php?id=11732 http://bugs.php.net/bug.php?id=10380 HTH, Nathan Clemons, Director of Virtual E-Services Network, Inc. Edit this bug report at http://bugs.php.net/?id=13629edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13342 Updated: A ! every 2041 letters
ID: 13342 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Feedback Bug Type: Mail related Operating System: Linux/Apache PHP Version: 4.0.4pl1 New Comment: I cannot recreate this 4.0.5 or current CVS. As for line length, RFC 821 says the following: text line The maximum total length of a text line including the CRLF is 1000 characters (but not counting the leading dot duplicated for transparency). Theorectically, it is the responsibility of the MTA (sendmail/postfix/Exim/qmail etc) to handle this not PHP. Can you recreate this with current CVS? Previous Comments: [2001-09-17 06:36:57] [EMAIL PROTECTED] most likely sendmail related as PHP mail() for unix just passes the message text to the local sendmail binary via popen() could someone please check the SMTP RFCs for line length limits ? [2001-09-17 06:17:29] [EMAIL PROTECTED] Hello, The script : $mail_body = ; for ($i=0; $i 500; $i++) { $mail_body .= aaa; } $subject = Testing; mail($adress, $subjet, $mail_body); When receiving the mail, a character ! is inserted every 2041 chars. If the message is changed into : $mail_body .= aaa\n; the received mail is good. It is not very usual to send a mail without carriage return, but we discovered this bug sending an HTML message, with br and without \n. Introducing some \n resolve the problem. Best regards Edit this bug report at http://bugs.php.net/?id=13342edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13333 Updated: ant, beatle?
ID: 1 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Unknown/Other Function Operating System: PHP Version: 4.0.6 New Comment: Such information will be useful for the 'PHP In Zoology Working Committee.' Otherwise, it is completely useless to us. Previous Comments: [2001-09-16 23:12:20] [EMAIL PROTECTED] Color - black. 3 segemented body. 1/2 to 2+ inches long. Tail segment starts off round goes flat, when alarmed two white stingers protrude. head will raise and tail will curl up similiar to a scorpion. Edit this bug report at http://bugs.php.net/?id=1edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13314 Updated: Warning: Supplied argument is not a valid MySQL result resource
ID: 13314 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: MySQL related Operating System: Red Hat Linux 7.1 PHP Version: 4.0.6 New Comment: Are you connecting to the MySQL database before you execute your query? Previous Comments: [2001-09-15 04:53:58] [EMAIL PROTECTED] Background: I am running RH7.1 with MySQL 3.23, PHP-Nuke 5.0, and phpBB 1.4.1 (both Nuke and the BB are using the same database). After reading through ticket number 10368, I removed PHP4.0.4, and compiled 4.0.6 using --with-mysql=/usr/ --with-apxs I continue to get the following error: Warning: Supplied argument is not a valid MySQL result resource. The code that produces this error is this: function cookiedecode($user) { global $cookie, $prefix; $user = base64_decode($user); $cookie = explode(:, $user); $result = mysql_query(select pass from $prefix._users. where uname='$cookie[1]'); list($pass)= mysql_fetch_row($result); if ($cookie[2] == $pass $pass != ) { return $cookie; } else { unset($user); unset($cookie); } } I have determined that everything works up until the mysql_fetch_row function. i did this by inserting die($result) on the line prior to mysql_fetch_row. The resulting output is this: Resource id #2 I have been able to run the query inside mysql, and went so far as to have php die at the $cookie[1] and $cookie[2], just to verify that it was looking at the right information. Any ideas or suggestions as far as this is concerned would be a great help. Thank you, -- Rex Edit this bug report at http://bugs.php.net/?id=13314edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13319 Updated: ereg_replace() with numeric 2nd argument
ID: 13319 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Regexps related Operating System: Linux PHP Version: 4.0.6 New Comment: You are correct in saying that the second argument is a 'replacement string', not a number. The documentation is very clear about this. Previous Comments: [2001-09-15 12:13:10] [EMAIL PROTECTED] When using ereg_replace() with a numeric 2nd argument (replacement string), this argument is treated as an empty string. ereg_replace('4', 3, '124') produces '12' instead of '123'. Edit this bug report at http://bugs.php.net/?id=13319edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13319 Updated: ereg_replace() with numeric 2nd argument
ID: 13319 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Regexps related Operating System: Linux PHP Version: 4.0.6 New Comment: closed. Previous Comments: [2001-09-15 13:11:01] [EMAIL PROTECTED] You are correct in saying that the second argument is a 'replacement string', not a number. The documentation is very clear about this. [2001-09-15 12:13:10] [EMAIL PROTECTED] When using ereg_replace() with a numeric 2nd argument (replacement string), this argument is treated as an empty string. ereg_replace('4', 3, '124') produces '12' instead of '123'. Edit this bug report at http://bugs.php.net/?id=13319edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13243 Updated: Error when using 2D array
ID: 13243 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Feedback Status: Closed Bug Type: Arrays related Operating System: Windows 98 SE PHP Version: 4.0.6 New Comment: Bogus. Previous Comments: [2001-09-11 02:01:33] [EMAIL PROTECTED] I cannot recreate this on Unix systems. Could you please give a short script, illustrating how the 2d array is being manipulated. [2001-09-11 01:51:58] [EMAIL PROTECTED] if (empty($pokoj[1][9])): ... this part of 2D array is realy empty. If I use 1D array, everything is OK, but i need 2D array. When Apache runing script with this row, Windows show error in module PHP4TS.DLL. P.S. I'm sorry, but my english is not good. Edit this bug report at http://bugs.php.net/?id=13243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #13243 Updated: Error when using 2D array
ID: 13243 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Arrays related Operating System: Windows 98 SE PHP Version: 4.0.6 New Comment: I cannot recreate this on Unix systems. Could you please give a short script, illustrating how the 2d array is being manipulated. Previous Comments: [2001-09-11 01:51:58] [EMAIL PROTECTED] if (empty($pokoj[1][9])): ... this part of 2D array is realy empty. If I use 1D array, everything is OK, but i need 2D array. When Apache runing script with this row, Windows show error in module PHP4TS.DLL. P.S. I'm sorry, but my english is not good. Edit this bug report at http://bugs.php.net/?id=13243edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12860 Updated: problem with strip_tags()
ID: 12860 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Strings related Operating System: Linux and Win PHP Version: 4.0.6 New Comment: Latest CVS now checks if ? is followed by 'xml'. If so, it treats it just like HTML. Check latest CVS to confirm that this works (www.php.net/downloads.php) Gavin Previous Comments: [2001-08-21 05:50:14] [EMAIL PROTECTED] It is done by MS Word and I can´t affect it. Although it isn't compliant, I think, that is a bug. Fnc strip_tags() has strip all tags anywhere inside the string. I can't check, if all tags in the string are valid. If you want to show if this is valid, I would have to call to Redmond :-) [2001-08-20 11:02:27] [EMAIL PROTECTED] This markup is not XHTML 1.0 compliant, from my readying. That is, I'm pretty sure ?xml ... must be the first line of the document. This, however, is not the reason why strip_tags is failing. It is failing because it recognises '?' (from ?xml ) as the beginning of PHP code - not xml. This presents problems with applying strip_tags to xhtml. The reason why this probably hasn't been picked up is that correct (??) XML declarations are of the form ?xml ... ? - which should not contain anything to be out put anyway. If you/anyone can show that this is valid we can work around it (by demoting the PHP strip_tags state to an HTML state). [2001-08-20 09:45:13] [EMAIL PROTECTED] When I have text exported from MS Word to HTML where is ?xml:namespace... (see $string) and I want strip tags from it, I get text before it only. example: ? $string = EOD BODYP class=MsoNormalBUI am hungry?xml:namespace prefix = o ns = urn:schemas-microsoft-com:office:office //U/B/P P class=MsoNormalI am really hungryo:p/o:p/SPAN/BODY EOD; var_dump(strip_tags($string)); ? output is: string(11) I am hungry Edit this bug report at http://bugs.php.net/?id=12860edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12860 Updated: problem with strip_tags()
ID: 12860 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Strings related Operating System: Linux and Win PHP Version: 4.0.6 New Comment: This markup is not XHTML 1.0 compliant, from my readying. That is, I'm pretty sure ?xml ... must be the first line of the document. This, however, is not the reason why strip_tags is failing. It is failing because it recognises '?' (from ?xml ) as the beginning of PHP code - not xml. This presents problems with applying strip_tags to xhtml. The reason why this probably hasn't been picked up is that correct (??) XML declarations are of the form ?xml ... ? - which should not contain anything to be out put anyway. If you/anyone can show that this is valid we can work around it (by demoting the PHP strip_tags state to an HTML state). Previous Comments: [2001-08-20 09:45:13] [EMAIL PROTECTED] When I have text exported from MS Word to HTML where is ?xml:namespace... (see $string) and I want strip tags from it, I get text before it only. example: ? $string = EOD BODYP class=MsoNormalBUI am hungry?xml:namespace prefix = o ns = urn:schemas-microsoft-com:office:office //U/B/P P class=MsoNormalI am really hungryo:p/o:p/SPAN/BODY EOD; var_dump(strip_tags($string)); ? output is: string(11) I am hungry Edit this bug report at http://bugs.php.net/?id=12860edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12785 Updated: Issuing a SELECT like '%xx' returns WRONG data!
ID: 12785 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: MySQL related Operating System: RedHat 7.1 PHP Version: 4.0.4 New Comment: This question is related to the MySQL database, not PHP. See www.mysql.com for support. Previous Comments: [2001-08-16 06:13:50] [EMAIL PROTECTED] SELECT * FROM CHEM where KEMIKALIE like '%ol' does NOT report only the KEMIKALIE ending with 'ol' BUT even those that include 'ol' that is: that do not end with 'ol' !!! Edit this bug report at http://bugs.php.net/?id=12785edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12713 Updated: felix
ID: 12713 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Feedback Bug Type: Feature/Change Request Operating System: linux PHP Version: 4.0.6 New Comment: More information is required here. Can we see some output data? ie, echo your sql query string. (It looks like this might be quite large. Best idea would be to output to a text file and give a URL.) Previous Comments: [2001-08-13 06:12:23] [EMAIL PROTECTED] It seems that the function addslashes() donesn't work correctly now. I write a program with the sql: insert into member(membername,photo) values('$membername','.addslashes($picdata).') It worked correctly on php 4.02,but now cannt.so I want know what happened and how to correct it. sorry for my poor english. Edit this bug report at http://bugs.php.net/?id=12713edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12720 Updated: An unnecessary extra slash
ID: 12720 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Session related Operating System: Linux RedHat 7.1 PHP Version: 4.0.6 New Comment: The extra slash is so that PHP is in compliance with XHTML 1.0. See http://www.w3.org/MarkUp/ for more information. Also, if this is causing your applications problems, you may be designing them incorrectly. Previous Comments: [2001-08-13 12:04:48] [EMAIL PROTECTED] input type=hidden name=PHPSESSID value=28d352f895d1d14d2121e32d80a69299 / When cookies are not available, PHP auto append the input above in each form of my page. My question is: why that slash is there in the end of the tag? It is making trouble in my site... Edit this bug report at http://bugs.php.net/?id=12720edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12252 Updated: URL rewriter outputs a spurious /
ID: 12252 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Session related Operating System: linux suse 6.4 PHP Version: 4.0.6 New Comment: This is not a spurious slash. This slash is present to make PHP XHTML 1.0 compliant. See more at: http://www.w3.org/TR/xhtml1/ swm Previous Comments: [2001-07-19 09:29:26] [EMAIL PROTECTED] the rewriter adds a / befor the closing bracket in the form rewriting. fallowing a diff to patch it. sincerely Daniel S. *** ext/standard/url_scanner_ex.c Thu Jun 21 08:29:04 2001 --- ext/standard/url_scanner_ex_modif.c Thu Jul 19 14:14:34 2001 *** static inline void handle_form(STD_PARA) *** 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \ /); } } --- 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \); } } Edit this bug report at http://bugs.php.net/?id=12252edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12252 Updated: URL rewriter outputs a spurious /
ID: 12252 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Session related Operating System: linux suse 6.4 PHP Version: 4.0.6 New Comment: I don't think it is. Here is the code: static inline void handle_form(STD_PARA) { if (ctx-tag.len == 4 strncasecmp(ctx-tag.c, form, 4) == 0) { smart_str_appends(ctx-result, input type=\hidden\ name=\); smart_str_append(ctx-result, ctx-q_name); smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); smart_str_appends(ctx-result, \ /); } } You'll notice that it is not a form tag we are adding. Rather, it is input/ Previous Comments: [2001-07-19 10:34:02] [EMAIL PROTECTED] actually that _is_ a bug. form is _not_ an empty element. [2001-07-19 10:08:38] [EMAIL PROTECTED] This is not a spurious slash. This slash is present to make PHP XHTML 1.0 compliant. See more at: http://www.w3.org/TR/xhtml1/ swm [2001-07-19 09:29:26] [EMAIL PROTECTED] the rewriter adds a / befor the closing bracket in the form rewriting. fallowing a diff to patch it. sincerely Daniel S. *** ext/standard/url_scanner_ex.c Thu Jun 21 08:29:04 2001 --- ext/standard/url_scanner_ex_modif.c Thu Jul 19 14:14:34 2001 *** static inline void handle_form(STD_PARA) *** 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \ /); } } --- 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \); } } Edit this bug report at http://bugs.php.net/?id=12252edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #12252 Updated: URL rewriter outputs a spurious /
ID: 12252 Updated by: swm Reported By: [EMAIL PROTECTED] Old Status: Open Status: Closed Bug Type: Session related Operating System: linux suse 6.4 PHP Version: 4.0.6 New Comment: Now closed. Previous Comments: [2001-07-19 10:37:52] [EMAIL PROTECTED] I don't think it is. Here is the code: static inline void handle_form(STD_PARA) { if (ctx-tag.len == 4 strncasecmp(ctx-tag.c, form, 4) == 0) { smart_str_appends(ctx-result, input type=\hidden\ name=\); smart_str_append(ctx-result, ctx-q_name); smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); smart_str_appends(ctx-result, \ /); } } You'll notice that it is not a form tag we are adding. Rather, it is input/ [2001-07-19 10:34:02] [EMAIL PROTECTED] actually that _is_ a bug. form is _not_ an empty element. [2001-07-19 10:08:38] [EMAIL PROTECTED] This is not a spurious slash. This slash is present to make PHP XHTML 1.0 compliant. See more at: http://www.w3.org/TR/xhtml1/ swm [2001-07-19 09:29:26] [EMAIL PROTECTED] the rewriter adds a / befor the closing bracket in the form rewriting. fallowing a diff to patch it. sincerely Daniel S. *** ext/standard/url_scanner_ex.c Thu Jun 21 08:29:04 2001 --- ext/standard/url_scanner_ex_modif.c Thu Jul 19 14:14:34 2001 *** static inline void handle_form(STD_PARA) *** 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \ /); } } --- 178,182 smart_str_appends(ctx-result, \ value=\); smart_str_append(ctx-result, ctx-q_value); ! smart_str_appends(ctx-result, \); } } Edit this bug report at http://bugs.php.net/?id=12252edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11537 Updated: We need an operator for prepending a string to a string. Something like =.
ID: 11537 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Feature/Change Request Operating system: PHP Version: 4.0.5 Assigned To: Comments: What is wrong with: $string = $prefix.$string; Gavin Previous Comments: --- [2001-06-18 09:41:08] [EMAIL PROTECTED] It's a feature-request, not a bug-report. --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11537edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11548 Updated: sub select??
ID: 11548 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Bogus Bug Type: MySQL related Operating system: PHP Version: Earlier? Upgrade first! Assigned To: Comments: This is not a users forum. Please address such queries to SQL/MySQL/php user lists or forums. Also, please read http://www.php.net/bugs-dos-and-donts.php before posting. Previous Comments: --- [2001-06-18 23:58:58] [EMAIL PROTECTED] dear sir i want to know if the followign scenario has some work around possible i have a table to project_users and a table of users. when some one joins my organization i add him in the user table adn then when he becomes a part of a project he is added to the project users table to add him to a project he should not already be a part of that project so i want to execute a query of the form select user_id from users where user_id NOT IN ( select user_id from project_users where project_id = $selected_project) but as you know mysql doesn't support sub-select .] so is there a workatround using php to handle this sub select pls reply soon thanx --akhil --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11548edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11075 Updated: bad operation of nl2br function
ID: 11075 Updated by: swm Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Strings related Operating system: PHP Version: 4.0.5 Assigned To: Comments: Please read the most recent manual entry (for 4.0.5). nl2br -- Inserts HTML line breaks before all newlines in a string Description string nl2br (string string) Returns string with 'br /' inserted before all newlines. This is to support the latest HTML recommendation (XHTML 1.0) Previous Comments: --- [2001-05-24 02:55:57] [EMAIL PROTECTED] nl2br function seems do not operate correctly. For example, $a = aaa bbb; $b = nl2br ($a); The correct value of $b is following: aaabr bbb But I got the wrong value like this: aaa br / bbb FYI, I have used PHP language for 2 years and the same code I tried worked well at the prior versions (PHP3.x, PHP4.0 ~ PHP4.0.4) --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11075edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11075 Updated: bad operation of nl2br function
ID: 11075 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Strings related Operating system: PHP Version: 4.0.5 Assigned To: Comments: Argh. Keep forgetting to close! Previous Comments: --- [2001-05-24 03:50:36] [EMAIL PROTECTED] As below. --- [2001-05-24 03:43:16] [EMAIL PROTECTED] Please read the most recent manual entry (for 4.0.5). nl2br -- Inserts HTML line breaks before all newlines in a string Description string nl2br (string string) Returns string with 'br /' inserted before all newlines. This is to support the latest HTML recommendation (XHTML 1.0) --- [2001-05-24 02:55:57] [EMAIL PROTECTED] nl2br function seems do not operate correctly. For example, $a = aaa bbb; $b = nl2br ($a); The correct value of $b is following: aaabr bbb But I got the wrong value like this: aaa br / bbb FYI, I have used PHP language for 2 years and the same code I tried worked well at the prior versions (PHP3.x, PHP4.0 ~ PHP4.0.4) --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11075edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11079 Updated: Problem with old code to use mysql
ID: 11079 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: MySQL related Operating system: PHP Version: 4.0.5 Assigned To: Comments: Are you sure the MySQL server is binding to domain sockets? ls -l /tmp/mysql.sock If mysqld is not running or is running with tcp connections only, then your default mysql_connect() will not work. Previous Comments: --- [2001-05-24 06:15:32] [EMAIL PROTECTED] Hello... I'm use the Linux Mandrake 8.0 with mysql 3.23.32 and Apache 1.3.19. Recently I install the 4.0.5 version of php and I can't use my old code to acess mysql server. The mysql_connect function give me the error Can't connect /tmp/mysql.sock (2). This old code was working fine with 4.0.4pl1 version of php. Can you tell what is the problem? Best Regards. Nuno Costa. --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11079edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11080 Updated: fopen(url) sleep before running
ID: 11080 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: URL related Operating system: PHP Version: 4.0.5 Assigned To: Comments: There is no domain www.belajar.com. It is possible that the reason it works after a few minutes is due to the DNS implementation on the system you are running your script on. Previous Comments: --- [2001-05-24 06:37:11] [EMAIL PROTECTED] i've just upgraded my PHP 3 to 4.0.4 then 4.0.5 when in PHP3, this will work perfectly fopen(http://www.belajar.com;, r); but when upgraded to 4.0.4pl1 then 4.0.5 the script hang for minutes.. no CPU and additional RAM was used.. the computer is just working like there is nothing going on. and after a few minutes the 'fopen(url)' finally continue to work - i'm configuring php with: ./configure --with-apxs --with-mysql --with-postgresql there are no warning and error message.. - i'm using the default php.ini --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11080edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #11051 Updated: mail function dosn't work
ID: 11051 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Mail related Operating system: PHP Version: 4.0.5 Assigned To: Comments: More information required: Does any email get sent? Do you have a syslog entry for the mail? I cannot workout which part of your site (linked) results in an email being sent (cannot understand =) Previous Comments: --- [2001-05-23 07:56:34] [EMAIL PROTECTED] Hello Dear Support Team, I have got this php code on www.phpwebhosting.com ?php $IMPemail = [EMAIL PROTECTED]; $EncryptIMPemail = crypt (crypt(chop($IMPemail), h3), Oi); $uzenet = crypt (crypt(chop($IMPemail), h3), Oi); $SERVER_NAME = allasajanlat.hu; mail([EMAIL PROTECTED], Téma, $uzenet, From: webmaster@$SERVER_NAMEnReply-To: webmaster@$SERVER_NAMEnX-Mailer: PHP/ . phpversion()); Header( Location: ./index.php); exit; ? but unfortunately it doesn't send any mail to [EMAIL PROTECTED] You can try it by http://www.allasajanlat.hu/new/allregisztral.php What is wrong with it? Thank you for your help in advance Best Regards Tibor Szaraz --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=11051edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10993 Updated: filesize on newly made/just opened file weirdness
ID: 10993 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Filesystem function related Operating system: PHP Version: 4.0.5 Assigned To: Comments: The results of filesize() are cached. You will need to reload the cache for this file in order that it return the correct result. See clearstatcache() and filesize() documentation. Previous Comments: --- [2001-05-21 13:34:21] [EMAIL PROTECTED] Hiya run this test script and and watch the output differ depending on using filesize or not $fp = fopen('file.test', a+b); //(un)comment this line filesize('file.test'); fwrite($fp, boe); fclose($fp); $fp2 = fopen('file.test', a+b); fseek($fp2, 0); echo fread($fp2, filesize('file.test')); unlink('file.test'); Greetz, Wico --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10993edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #8317 Updated: postgresql table uppercase field name
ID: 8317 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: PostgreSQL related Operating system: PHP Version: 4.0.3 Assigned To: Comments: For lack of a script I can only presume that you have not correctly escaped that double quotes meaning that you get either a parse error or, having left them out, get an error from PG because the PG parser converts unquoted table names to lower case. Any other queries about postgresql and PHP should be addressed to the general lists. Previous Comments: --- [2000-12-18 20:29:30] [EMAIL PROTECTED] Hi: I use Redhat OS, postgresql database and PHP build my website, I import datas to postgresql, and all the table field name is uppercase like the follwing: Attribute |Type | Modifier ---+-+-- WHFILE| varchar(10) | WHFLDI| varchar(10) | WHFLDE| varchar(10) | WHIBO | integer | WHFLDB| integer | WHFLDD| smallint| WHFLDP| smallint| WHFTXT| varchar(50) | WHFLDT| varchar(1) | psql query like following can do: movextest=# select WHFILE, WHFLDI,WHFTXT from cfiffd00 where WHFILE like upper('%mpccid%'); but in PHP the query can not run! why? and how to run like this condition? --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=8317edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10121 Updated: Case Sensitive Associative Arrays
ID: 10121 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: PostgreSQL related Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: This query performs exactly as it should. If you had have enclosed the create table columns in quotes, they would have been treated case sensitively (in the create and subsequently in the query) as well as by the associative array. Your query proves this. Previous Comments: --- [2001-04-02 17:49:01] [EMAIL PROTECTED] Rereading that last line its a little confusing. If you want to input table or column names as mixed case you need to enclose them in quotes otherwise they are lowered. Then when you make a query you would also need to enclose the query names in quotes as it is also lowered automatically if there are no quotes. However this behavior is not shared by associative arrays in PHP for some reason. --- [2001-04-02 17:27:00] [EMAIL PROTECTED] Rereading that last line its a little confusing. If you want to input table or column names as mixed case you need to enclose them in quotes otherwise they are lowered. Then when you make a query you would also need to enclose the query names in quotes as it is also lowered automatically if there are no quotes. However this behavior is not shared by associative arrays in PHP for some reason. --- [2001-04-02 16:11:52] [EMAIL PROTECTED] The scenario is described here: mydb= CREATE TABLE test ( U_Name char(50), U_Pass char(16) ); mydb= INSERT INTO test values ('Bob', 'password'); query.php: ? $conn = pg_connect(dbname=mydb); $result = pg_exec($conn, select U_Name, U_Pass from test) $arr = pg_fetch_array($result, 0); echo U_Name: + $arr[U_Name] + U_Pass: + $arr[U_Pass] + BR; echo u_name: + $arr[u_name] + u_pass: + $arr[u_pass] + BR; ? results that are printed:U_Name: U_Pass: u_name: Bob u_pass: password ( arr[0] = Bob, arr[1] = password) U_Name is not being automatically lowercased when using associative arrays. As of v6.1 PostgreSQL lowercases all table names as well as all columns. So searching on mixed case or uppercase names will not work unless they are enclosed in quotes.. --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10121edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10976 Updated: No support for other encoding in XSLT functions
ID: 10976 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Sablotron XSL Operating system: PHP Version: 4.0.5 Assigned To: Comments: A sample script please. Previous Comments: --- [2001-05-20 16:11:54] [EMAIL PROTECTED] I run PHP 4.0.5 on Windows 2000 with Apache Web Server. The problem is that I can't use the function xslt_process() with strings containing non-English characters (Greek particularly). The only solution for now is to encode the strings to UTF-8, but this requires setting the browser's encoding to UTF-8 which forces me to encode everything to UTF-8 before displaying it. I contacted Ginger Alliance and they told me that Sablotron works ok when the PHP extension is linked to and compiled with ilibconv.dll BUT I don't know exactly how this is done. They said that Sterling Hughes is working on a new version for Sablotron and I would like to request that this new extension works with other character encodings too. --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10976edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10044 Updated: Bug in shm_remove() and inadequate implementation of SYSVSem.
ID: 10044 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Semaphore related Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: Fix in current CVS Previous Comments: --- [2001-03-28 20:18:51] [EMAIL PROTECTED] There is a bug in shm_remove() that comes from the fact that the function is treating its argument, shm_identifier, as a shm key. The function argument should be shm_identifier. The patch appended fixes this problem. There is also an implementation issue with SYSV Semaphores. There is no method of removing unrequired semaphores. See the patch appended for a function, sem_remove, which can do this. I am happy to take over maintenance of this section. As for the patches, I have had to cut and paste them so I am unsure if Mozilla has wrapped certain lines. If so, I will email them. - Patch - --- ext/sysvshm/sysvshm.c.orig Fri Mar 16 01:22:16 2001 +++ ext/sysvshm/sysvshm.c Fri Mar 16 01:42:15 2001 @@ -173,26 +173,40 @@ /* }}} */ /* {{{ proto int shm_remove(int shm_identifier) Removes shared memory from Unix systems */ + +/* patched to use the correct argument Fri Mar 16 01:22:50 EST 2001 + * Gavin Sherry [EMAIL PROTECTED] + */ + PHP_FUNCTION(shm_remove) { - pval **arg_key; + pval **arg_id; long id; - key_t key; + int type; + sysvshm_shm *shm_list_ptr; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_key) == FAILUR E) { + if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_id) == FAILURE ) { WRONG_PARAM_COUNT; } - convert_to_long_ex(arg_key); + convert_to_long_ex(arg_id); - key = (*arg_key)-value.lval; + id = (*arg_id)-value.lval; +/* + * this isn't what we're looking to do + */ + +/* if((id=shmget(key,0,0))0) { php_error(E_WARNING, %d is not a existing SysV shared memory ke y, key); RETURN_FALSE; } - if(shmctl(id,IPC_RMID,NULL)0) { - php_error(E_WARNING, shm_remove() failed for key 0x%x: %s, key , strerror(errno)); +*/ + + shm_list_ptr = (sysvshm_shm *) zend_list_find(id, type); + if(shmctl(shm_list_ptr-id,IPC_RMID,NULL)0) { + php_error(E_WARNING, shm_remove() failed for key 0x%x, id %i: %s,shm_list_ptr-key,id,strerror(errno)); RETURN_FALSE; } --- ext/sysvsem/php_sysvsem.h.orig Fri Mar 16 01:44:26 2001 +++ ext/sysvsem/php_sysvsem.h Fri Mar 16 01:44:17 2001 @@ -30,6 +30,7 @@ PHP_FUNCTION(sem_get); PHP_FUNCTION(sem_acquire); PHP_FUNCTION(sem_release); +PHP_FUNCTION(sem_remove); typedef struct { int le_sem; --- ext/sysvsem/sysvsem.c.orig Thu Mar 15 22:40:18 2001 +++ ext/sysvsem/sysvsem.c Thu Mar 15 23:15:17 2001 @@ -53,6 +53,7 @@ PHP_FE(sem_get, NULL) PHP_FE(sem_acquire, NULL) PHP_FE(sem_release, NULL) + PHP_FE(sem_remove, NULL) {NULL, NULL, NULL} }; @@ -92,6 +93,14 @@ sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc-ptr; struct sembuf sop[2]; +/* + * if count == -1, semaphore has been removed + * Need better way to handle this + */ + + if(sem_ptr-count == -1) { + return; + } /* Decrement the usage count. */ sop[0].sem_num = SYSVSEM_USAGE; @@ -343,6 +352,63 @@ { php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } +/* }}} */ + + + + +/* {{{ proto int sem_remove(int id) + Removes semaphore from Unix systems */ + +/* + * contributed by Gavin Sherry [EMAIL PROTECTED] + * Fri Mar 16 00:50:13 EST 2001 + */ + +PHP_FUNCTION(sem_remove) +{ +pval **arg_id; +int id,type; + sysvsem_sem *sem_ptr; +#if HAVE_SEMUN + union semun un; +#endif +if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_id) == FAILUR E) { +WRONG_PARAM_COUNT; +} +convert_to_long_ex(arg_id); + +id = (*arg_id)-value.lval; + +sem_ptr = (sysvsem_sem *) zend_list_find(id, type); + +if (type!=php_sysvsem_module.le_sem) { +php_error(E_WARNING, %d is not a SysV semaphore index, id); +RETURN_FALSE; +} + +#if HAVE_SEMUN +if(semctl(sem_ptr-semid,NULL,IPC_STAT,un)0) { +#else + if(semctl(sem_ptr-semid,NULL,IPC_STAT,NULL)0) { +#endif +php_error(E_WARNING, %d is not a existing SysV Semaphore Id, id); +RETURN_FALSE; +} + + if(semctl(sem_ptr-semid,NULL,IPC_RMID,NULL)0) { +php_error(E_WARNING, sem_remove() failed for id %d: %s, id, s trerror(errno)); +RETURN_FALSE
[PHP-DEV] Bug #9032 Updated: Problems with shm_remove
ID: 9032 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Closed Bug Type: Documentation problem Operating system: PHP Version: 4.0.4pl1 Assigned To: Comments: Having committed a fix to CVS, PHP now works according to the documentation. Previous Comments: --- [2001-01-31 10:15:04] [EMAIL PROTECTED] We are having problems using shm functions. Taking a look at sysvshm.c, it seems that shm_remove take as argument **key** and not **shm_identifier** as documented (even on the snapshot documentation). Some tests show the same results. Here follows the code to test it: ?php $key = 5; $shm_identifier = shm_attach($key); shm_remove($shm_identifier); $key = 6; $shm_identifier = shm_attach($key); shm_remove($shm_identifier); $key = 7; $shm_identifier = shm_attach($key); shm_remove($shm_identifier); echo Many warnings appeared abovebr; shm_remove(5); shm_remove(6); shm_remove(7); echo No warnings nowbr; ? Regards, Claudio Neves --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9032edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #10874 Updated: getcwd() always return empty string.
ID: 10874 Updated by: swm Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Directory function related Operating system: PHP Version: 4.0.5 Assigned To: Comments: Cannot recreate this on any system with current CVS. Previous Comments: --- [2001-05-15 05:42:36] [EMAIL PROTECTED] ?php echo '.getcwd().'; ? --- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10874edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] PHP 4.0 Bug #10044: Bug in shm_remove() and inadequate implementation of SYSVSem.
From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.0.4pl1 PHP Bug Type: Unknown/Other Function Bug description: Bug in shm_remove() and inadequate implementation of SYSVSem. There is a bug in shm_remove() that comes from the fact that the function is treating its argument, shm_identifier, as a shm key. The function argument should be shm_identifier. The patch appended fixes this problem. There is also an implementation issue with SYSV Semaphores. There is no method of removing unrequired semaphores. See the patch appended for a function, sem_remove, which can do this. I am happy to take over maintenance of this section. As for the patches, I have had to cut and paste them so I am unsure if Mozilla has wrapped certain lines. If so, I will email them. - Patch - --- ext/sysvshm/sysvshm.c.orig Fri Mar 16 01:22:16 2001 +++ ext/sysvshm/sysvshm.c Fri Mar 16 01:42:15 2001 @@ -173,26 +173,40 @@ /* }}} */ /* {{{ proto int shm_remove(int shm_identifier) Removes shared memory from Unix systems */ + +/* patched to use the correct argument Fri Mar 16 01:22:50 EST 2001 + * Gavin Sherry [EMAIL PROTECTED] + */ + PHP_FUNCTION(shm_remove) { - pval **arg_key; + pval **arg_id; long id; - key_t key; + int type; + sysvshm_shm *shm_list_ptr; - if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_key) == FAILUR E) { + if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_id) == FAILURE ) { WRONG_PARAM_COUNT; } - convert_to_long_ex(arg_key); + convert_to_long_ex(arg_id); - key = (*arg_key)-value.lval; + id = (*arg_id)-value.lval; +/* + * this isn't what we're looking to do + */ + +/* if((id=shmget(key,0,0))0) { php_error(E_WARNING, "%d is not a existing SysV shared memory ke y", key); RETURN_FALSE; } - if(shmctl(id,IPC_RMID,NULL)0) { - php_error(E_WARNING, "shm_remove() failed for key 0x%x: %s", key , strerror(errno)); +*/ + + shm_list_ptr = (sysvshm_shm *) zend_list_find(id, type); + if(shmctl(shm_list_ptr-id,IPC_RMID,NULL)0) { + php_error(E_WARNING, "shm_remove() failed for key 0x%x, id %i: %s",shm_list_ptr-key,id,strerror(errno)); RETURN_FALSE; } --- ext/sysvsem/php_sysvsem.h.orig Fri Mar 16 01:44:26 2001 +++ ext/sysvsem/php_sysvsem.h Fri Mar 16 01:44:17 2001 @@ -30,6 +30,7 @@ PHP_FUNCTION(sem_get); PHP_FUNCTION(sem_acquire); PHP_FUNCTION(sem_release); +PHP_FUNCTION(sem_remove); typedef struct { int le_sem; --- ext/sysvsem/sysvsem.c.orig Thu Mar 15 22:40:18 2001 +++ ext/sysvsem/sysvsem.c Thu Mar 15 23:15:17 2001 @@ -53,6 +53,7 @@ PHP_FE(sem_get, NULL) PHP_FE(sem_acquire, NULL) PHP_FE(sem_release, NULL) + PHP_FE(sem_remove, NULL) {NULL, NULL, NULL} }; @@ -92,6 +93,14 @@ sysvsem_sem *sem_ptr = (sysvsem_sem *)rsrc-ptr; struct sembuf sop[2]; +/* + * if count == -1, semaphore has been removed + * Need better way to handle this + */ + + if(sem_ptr-count == -1) { + return; + } /* Decrement the usage count. */ sop[0].sem_num = SYSVSEM_USAGE; @@ -343,6 +352,63 @@ { php_sysvsem_semop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } +/* }}} */ + + + + +/* {{{ proto int sem_remove(int id) + Removes semaphore from Unix systems */ + +/* + * contributed by Gavin Sherry [EMAIL PROTECTED] + * Fri Mar 16 00:50:13 EST 2001 + */ + +PHP_FUNCTION(sem_remove) +{ +pval **arg_id; +int id,type; + sysvsem_sem *sem_ptr; +#if HAVE_SEMUN + union semun un; +#endif +if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg_id) == FAILUR E) { +WRONG_PARAM_COUNT; +} +convert_to_long_ex(arg_id); + +id = (*arg_id)-value.lval; + +sem_ptr = (sysvsem_sem *) zend_list_find(id, type); + +if (type!=php_sysvsem_module.le_sem) { +php_error(E_WARNING, "%d is not a SysV semaphore index", id); +RETURN_FALSE; +} + +#if HAVE_SEMUN +if(semctl(sem_ptr-semid,NULL,IPC_STAT,un)0) { +#else + if(semctl(sem_ptr-semid,NULL,IPC_STAT,NULL)0) { +#endif +php_error(E_WARNING, "%d is not a existing SysV Semaphore Id", id); +RETURN_FALSE; +} + + if(semctl(sem_ptr-semid,NULL,IPC_RMID,NULL)0) { +php_error(E_WARNING, "sem_remove() failed for id %d: %s", id, s trerror(errno)); +RETURN_FALSE; +} + + /* let release_sysvsem_sem knows we have removed +* the semaphore to avoid issues with releasing. +*/ + + sem_ptr-count = -1; +RETURN_TRUE; +} + /* }}} */ #endif /* HAVE_SYSVSEM */ -- Edit Bug report at: http://bugs.php.net/?id=10044edit=1