php-general Digest 2 Jul 2009 13:45:48 -0000 Issue 6207

Topics (messages 294818 through 294827):

Re: exasperated again
        294818 by: Maximiliano Churichi

PHP --info giving segmentation fault
        294819 by: Vivek Katakam

PHP Raw-listing Problem
        294820 by: Parham Doustdar

Re: removing an array from a compound array
        294821 by: Ford, Mike
        294823 by: zhoo
        294827 by: Andres Gonzalez

Re: Apache module PHP 5.3 on Windows
        294822 by: Lester Caine

Re: PHP 5.3.0 Released!
        294824 by: Nick Cooper
        294825 by: Michael A. Peters

Dom PDF Problem
        294826 by: Pravinc

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
2009/6/30 PJ <[email protected]>:
> Could somebody please explain to me what is wrong with this code?
> In my script it works, returns the correct id, but when I try it in a
> test pages, nothing in the world gets it to work. This is rather
> frustrating, again:
> THIS WORKS IN ANOTHER PAGE; IN THE TEST PAGE ID DOES NOT.
> $sql = "SELECT id FROM publishers
>        WHERE publisher = 'whoever'";
>      $result = mysql_query($sql,$db);
>        $row = mysql_fetch_assoc($result);
>          if (mysql_num_rows($result) !== 0) {
>          $pub = $row['id'];
> Syntax is ok, echo "hello"; works.
>
>
> This works in the test page:
> $aid = array();
> $ord = array();
> $sql = "SELECT authID, ordinal
>        FROM book_author WHERE bookid = 624 ORDER BY ordinal ASC";
>        $result = mysql_query($sql, $db);
>            //$row = mysql_fetch_assoc($result);
>            while ( $row = mysql_fetch_assoc($result) ) {
>            $aid[]=$row['authID'];
>            $ord[]=$row['ordinal'];
>            }
>            var_dump($aid);
>            echo "<br />";
>            var_dump($ord);
>            echo $aid[0], " - ";
>            echo $ord[0];
>
> This does not:
> $fi="joe"; $la="joe";
> $sql = "SELECT id FROM author
>        WHERE first_name = '$fi' && last_name = '$la'";
>    $result = msql_query($sql, $db);
>        $row = mysql_fetch_assoc($result);
>        $count=mysql_num_rows($result);
>    echo $count;
>          if (mysql_num_rows($result) > 0) {
>          $a_id=$row['id'];
>          }
>          echo $a_id, "<br /><br />";
> The test page prints out echo "some text"; but no results when the
> results are there....
> Tell me I have missed something simple here, or is this normal for php ?
> I have checked the queries on Mysql command line and they are fine.
> I have verified the syntax and Netbeans tells me it is fine.
> Same results Firefox3 (2 machines) & IE 8.
> What is not fine?
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- [email protected]
>   http://www.ptahhotep.com
>   http://www.chiccantine.com/andypantry.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Is that exactly your code?
see your 4th line:
> $result = msql_query($sql, $db);
you forgot the "y" in mysql_query function...
if you have a 500 error code maybe this is the problem


-- 
Maximiliano Churichi
<[email protected]>

--- End Message ---
--- Begin Message ---
 Hi All,

I am using CentOS 5.3-x8664.  I installed PHP and Apache httpd. The
following are the version informations present on the system:

#httpd -v
Server version: Apache/2.2.3
# php -v
PHP 5.1.6 (cli) (built: Jan 21 2009 01:45:01)
The problem is when accessing through web page it is giving blank, i
am getting the following error messages in /var/log/httpd/error_log:
...
...
[Wed Jul 01 00:48:58 2009] [notice] child pid 4408 exit signal
Segmentation fault (11)
[Wed Jul 01 00:49:10 2009] [notice] child pid 4411 exit signal
Segmentation fault (11)
[Wed Jul 01 00:55:32 2009] [notice] caught SIGTERM, shutting down
[Wed Jul 01 00:55:43 2009] [notice] Digest: generating secret for
digest authentication ...
[Wed Jul 01 00:55:43 2009] [notice] Digest: done
[Wed Jul 01 00:55:43 2009] [notice] Apache/2.2.3 (CentOS) configured
-- resuming normal operations
*** glibc detected *** /usr/sbin/httpd: double free or corruption
(out): 0x00002ab491c70cf0 ***
...
...
>From the command prompt when i ran the following i got the following
error as the root cause:
# php --info
....
....
.....
.....
curl
CURL support => enabled
CURL Information => libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
date
*** glibc detected *** php: munmap_chunk(): invalid pointer:
0x00002b605055cc00 ***
======= Backtrace: =========
/lib64/libc.so.6(cfree+0x1b6)[0x3bd2675a36]
php(timelib_builtin_db+0x283)[0x46f5d3]
php(zm_info_date+0xa3)[0x456b23]
php[0x4f3614]
php(zend_hash_apply_with_argument+0x3f)[0x58360f]
php(php_print_info+0xa04)[0x4f4a04]
php(main+0x400)[0x5f26d0]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3bd261d974]
php[0x437bc9]
======= Memory map: ========
00400000-00684000 r-xp 00000000 08:01 2021503
 /usr/bin/php
00883000-008a6000 rw-p 00283000 08:01 2021503
 /usr/bin/php
008a6000-008b3000 rw-p 008a6000 00:00 0
00aa5000-00ab8000 rw-p 002a5000 08:01 2021503
 /usr/bin/php
0e082000-0e1ed000 rw-p 0e082000 00:00 0                                  [heap]
3bd2200000-3bd221c000 r-xp 00000000 08:01 2512616
 /lib64/ld-2.5.so
3bd241b000-3bd241c000 r--p 0001b000 08:01 2512616
 /lib64/ld-2.5.so
3bd241c000-3bd241d000 rw-p 0001c000 08:01 2512616
 /lib64/ld-2.5.so
3bd2600000-3bd274c000 r-xp 00000000 08:01 2512617
 /lib64/libc-2.5.so
3bd274c000-3bd294c000 ---p 0014c000 08:01 2512617
 /lib64/libc-2.5.so
3bd294c000-3bd2950000 r--p 0014c000 08:01 2512617
 /lib64/libc-2.5.so
3bd2950000-3bd2951000 rw-p 00150000 08:01 2512617
 /lib64/libc-2.5.so
....
.....
.....
Aborted

Can someone help me in resolving the above errors.


Thanks and Regards,
Vivek

--- End Message ---
--- Begin Message ---
Hi there everyone,
First of all, let me thank you for your always-present help in this list; I (as 
a newbie) appreciate it very much! :)
However, pardon me for I need to trouble you with another piece of text that 
doesn't do what it should do:
I need to parse the raw-listing of an FTP into it's parts (the code comes from 
the book published by Wrox, however, I don't have the book in my posession to 
check the two versions against each other), but it returns an empty list. Here 
is the code:
[code]
switch ($this->systype){ //Parse raw dir listing into fields
 case 'Windows_NT':  //Handle WinNT FTP servers
 $re = '/^.' .
 '([0-9-]+\s+)'.   //Get last mod date
 '\d\d:\d\d..)\s+' .  //Get last mod time
 '(\S+)\s+' .    //Get size or dir info
 '(.+)$/';    //Get file/dir name
 break;
 
 case 'UNIX':   //Handle UNIX FTP servers
 default:    //case UNIX falls through to default
  $re = '/'.   //Regax to parse common server dir into
  '^(.)' .   //Get entry type info (file/dir/etc.)
  '(\S+)\s+' .   //Get permissions info
  '\S+\s+'.   //Find, but don't capture hard link info
  '(\S+)\s+' .  //Get owner name
  '(\S+)\s+' .  //Get group name
  '(\S+)\s+' .  //Get size
  '(\S+\s+\S+\s+\S+\s+)' . //Get file/dir last mod time
  '(.+)$/';   //Get file/dir name
  break;
 }
 
 //Map short identifiers to full names
 $type = array('-'=>'file','d'=>'directory');
 
 $listing = array();
 
 foreach ($temp as $entry) {  //loop through raw listings
 //try to parse raw data into fields
 $match=preg_match($re,$entry,$matches);
 
  if(!$match) {   //if we could not parse the listings
  user_error("The directory listings could not be parsed.");
  return array();   
  }
 
 switch ($this->systypes){  //Give fileds sensible names
 case 'Windows_NT';    //Handle WinNT-style dir listings
  $listings[] = array( //Put parsed data into readable format
  'type' =>
    is_numeric($matches[2]) ? 'file' : 'directory','permissions' => 
null,'owner' =>NULL,'group'=>null,'size'=>(int)$matches[2],
    'last mod' => $matches[1],'name'=>$matches[3]);
 break;
 
 case 'UNIX':  //Handle UNIX FTP-style dir listings
 default:   //case UNIX fails through to default
 $strings[] = array( //Put data into readable format
 'type' =>$type[$matches[1]],'permissions' => $matches[2],'owner' 
=>$matches[3],'group' => $matches[4],'size' => $matches[5],
 'last mod' =>$matches[6],'name'=>$matches[7]);
 break;
  
 }
 } 
  return $listings;
[/code]

Since this function is called Is($directory); I tried this:
var_dump($ftp_server->Is($ftp_server->cwd));

However, I get null.

Why?

(It's not that I understand how the raw-listing is being parsed using regular 
expressions, so it's why I'm asking :) )

Thanks!
-- 
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Andres Gonzalez [mailto:[email protected]]
> Sent: 02 July 2009 00:46
> To: [email protected]
> Subject: [PHP] removing an array from a compound array
> 
> I have a compound array, that is, an array of an array of an array,
> etc,
> that is about 5 arrays
> deep. I currently search thru all of these arrays, and based on some
> criteria, I want to delete
> one of the arrays (along with all of its sub-arrays) in the middle.
> 
> What is the easiest way to delete such an "embedded" array?

If you know all the keys leading to the subarray you want to remove
(which you probably do if you've just searched your way to it), then a
simple unset() should work, similar to:

    Unset($array[$key1][$key2][$key3]);


Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: [email protected]
Tel: +44 113 812 4730




To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
yes,i agree with Mike's method.


2009-07-02 



zhoo 



发件人: Ford, Mike 
发送时间: 2009-07-02  15:12:20 
收件人: Andres Gonzalez; [email protected] 
抄送: 
主题: RE: [PHP] removing an array from a compound array 
 
> -----Original Message-----
> From: Andres Gonzalez [mailto:[email protected]]
> Sent: 02 July 2009 00:46
> To: [email protected]
> Subject: [PHP] removing an array from a compound array
> 
> I have a compound array, that is, an array of an array of an array,
> etc,
> that is about 5 arrays
> deep. I currently search thru all of these arrays, and based on some
> criteria, I want to delete
> one of the arrays (along with all of its sub-arrays) in the middle.
> 
> What is the easiest way to delete such an "embedded" array?
If you know all the keys leading to the subarray you want to remove
(which you probably do if you've just searched your way to it), then a
simple unset() should work, similar to:
    Unset($array[$key1][$key2][$key3]);
Cheers!
Mike
 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: [email protected]
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Duh! I should have known that.

I actually tried that and had a problem so I thought unset() would not work
on an array. Guess that problem was elsewhere.

Thanks for the responses...

-Andres



Ford, Mike wrote:
-----Original Message-----
From: Andres Gonzalez [mailto:[email protected]]
Sent: 02 July 2009 00:46
To: [email protected]
Subject: [PHP] removing an array from a compound array

I have a compound array, that is, an array of an array of an array,
etc,
that is about 5 arrays
deep. I currently search thru all of these arrays, and based on some
criteria, I want to delete
one of the arrays (along with all of its sub-arrays) in the middle.

What is the easiest way to delete such an "embedded" array?

If you know all the keys leading to the subarray you want to remove
(which you probably do if you've just searched your way to it), then a
simple unset() should work, similar to:

    Unset($array[$key1][$key2][$key3]);


Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Email: [email protected]
Tel: +44 113 812 4730




To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm


--- End Message ---
--- Begin Message ---
Jonathan Tapicer wrote:
What version, VC6 or VC9, TS or NTS? I use VC6 TS and the dll is there...

Of cause no one has asked yet which version you use if you have to test BOTH Apache and IIS ;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
Does anyone have any further information on the PECL Binaries for 5.3, will
they be released?

2009/6/30 pan <[email protected]>

> Lukas Kahwe Smith wrote:
> >> Hello!
> >>
> >> The PHP Development Team would like to announce the immediate release
> >> of PHP 5.3.0. This release is a major improvement in the 5.X series,
> >> which includes a large number of new features and bug fixes.
> >>
> >> Release Announcement: http://www.php.net/release/5_3_0.php
> >> Downloads:            http://php.net/downloads.php#v5.3.0
> >> Changelog:            http://www.php.net/ChangeLog-5.php#5.3.0
> >>
> >> regards,
> >> Johannes and Lukas
>
> Great !
>
> The downloads page is devoid of any note in re pRCL binaries
> for Windows.
> windows.php.net doesn't say anything either of which pre-existing
> PECL binaries will work with 5_3.
>
> Is the 5_2_6 set of PECL binaries compatible with 5_3 ?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Nick Cooper wrote:
Does anyone have any further information on the PECL Binaries for 5.3, will
they be released?

I don't, but I suspect it is just a matter of compile + test.

On Linux (CentOS) I've only done testing with i386 but none of the pecl modules I personally am using w/ 5.2.9 failed to build (for i386 or x86_64) and they all seem to work as expected (i386). So I expect for most of them, the distributed binaries will appear once they have had a little testing.

-=-
The problems I personally have run into:

eAccelerator (stable) fails to build.
Devel version does (at least according to their bug system) but does not work properly.

suhosin module builds and works but kills the ability of pear to properly work (pear packages work fine, it's the package management that suhosin kills - can't even list channels w/o segfault)

Many of the pear packages throw deprecation errors to screen if you have display_errors enabled. They seem to work, and it seems that these are errors that were thrown before as well but only under strict reporting. My guess is they are being brought to the forefront so the code can be fixed before php 6. Not a biggie if error reporting disabled, but a PITA on a development machine where you are trying to see errors thrown in *your* code.

Maybe it's time for the community to go through pear, fix the errors, and submit patches to the maintainers that take care of the deprecated usage.
--- End Message ---
--- Begin Message ---
Hey all,

I am working with generating PDF using Dom PDF.

My problem is when I generate a single PDF , Its working fine.

But when I code it in a loop for generating more than one PDF it gives some
error.

 

                

   $DomObj = new DOMPDF();

 $DomObj->load_html_file($pth); 

$DomObj->render();

$pdf = $DomObj->output(); 

file_put_contents($MainDir."/Order-".$rsOrder[$ro]['OrderNumber']."/packing_
slip.pdf", $pdf);

 

the above code is in a loop

 

I come to know that ,there is problem with memory leak.

Also I thought that it was because I had not destroy the previously created
Object.

So I also tried destroying it using unset.. I don't know whether its
destroying or not.

 

 

Error is something like 

"Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No
block-level parent found. Not good.' in
D:\foldername\project\control\dompdf\include\inline_positioner.cls.php:68
Stack trace: #0 D:\foldername\ project
\control\dompdf\include\frame_decorator.cls.php(381):
Inline_Positioner->position() #1 D:\foldername\ project
\control\dompdf\include\inline_frame_reflower.cls.php(56):
Frame_Decorator->position(".........

 

 

Can anyone please give me some way to solve this.


--- End Message ---

Reply via email to