Results 1 to 10 of 10

Thread: csv

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167

    csv

    Debian etch AMD64, PHP 5.2.0-8+etch10, MySQL 5.0.32, Apache 2.2.3.

    vtiger 5.03 leads- 10 , 24000 - , , , MySQL. Apache error.log-
    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /var/www/vtigercrm/modules/Import/parse_utils.php on line 48
    , 3-4 , vtiger.

    vtiger CentOS4.6 PHP 4.3.10 11, apache 2. , 8-10 . . php.ini , debian memory_limit CentOS- 64MB. - .

    php.ini-
    max_execution_time = 600
    max_input_time = 600
    memory_limit = 64M
    post_max_size = 16M
    upload_max_filesize = 10M

    parse_utils.php:

    Code:
    function parse_import($file_name,$delimiter,$max_lines,$has_header)
    {
    	$line_count = 0;
    
    	$field_count = 0;
    
    	$rows = array();
    
    	if (! file_exists($file_name))
    	{
    		return -1;
    	}
    
    	$fh = fopen($file_name,"r");
    
    	if (! $fh)
    	{
    		return -1;
    	}
    
    	while ( (( $fields = fgetcsv($fh, 4096, $delimiter) ) !== FALSE) 
    		&& ( $max_lines == -1 || $line_count < $max_lines)) 
    	{
    
    		if ( count($fields) == 1 && isset($fields[0]) && $fields[0] == '')
    		{
    			break;
    		}
    		$this_field_count = count($fields);
    
    		if ( $this_field_count > $field_count)
    		{
    			$field_count = $this_field_count;
    		}
    
    		array_push($rows,$fields);
    
    		$line_count++;
    
    	}
    Code:
    while ( (( $fields = fgetcsv($fh, 4096, $delimiter) ) !== FALSE) 
    		&& ( $max_lines == -1 || $line_count < $max_lines))
    48. ? PHP/apache ? ? , , - ?

    vtiger - .

    , , php , ,
    , import now .
    Attached Files
    Last edited by ilko; 28th February 2008 at 02:05.

  2. #2
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    , parse_utils.php?
    , while , brak-... ?!

    $max_lines == -1 while , ..

    Code:
    while ( (( $fields = fgetcsv($fh, 4096, $delimiter) ) !== FALSE) 
    		&& $line_count < $max_lines) 
    {
    
        if( $max_lines == -1)
           break;
           
          ...
    
    }
    " , , , , ."

  3. #3
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    , . . , apache/php/mysql.
    , PHP4 , 5 . , . , "$123767.56", , .. - .

  4. #4
    Defender Kaspirtov's Avatar
    Join Date: Jun:2006
    Location: Sf
    Posts: 7,414
    Quote Originally Posted by ilko View Post
    , . . , apache/php/mysql.
    , PHP4 , 5 . , . , "$123767.56", , .. - .
    ... fgetcsv False, while break-...

    , while ( ) , fgetcsv !== False ?! - false fail ?
    " , , , , ."

  5. #5
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    - .
    VMware debian 4 + AMP, vtiger. PHP . 5.2, 5.0 , 5.2, . .
    5.0 5.2 , ,
    .

  6. #6
    relative dude Skydive's Avatar
    Join Date: Nov:2002
    Location: /
    Posts: 2,863
    , , ?
    , : ( ) , : "INSERT INTO _... VALUES(comma separated1, comma separated2)" , : "insert into table key="val", key2="val2" ", . , , ( ). ...
    , 5.0 5.2 . . ( )? ....
    Last edited by Skydive; 29th February 2008 at 15:45.

  7. #7
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    php4* apt-get- .
    5- . wmware- , .
    phpinfo() .
    2, :

    Apache Environment:

    HTTP_PRAGMA no cache
    HTTP_CACHE_CONTROL no cache

    . .

    Skydive, ,

    edit: , ctrl+F5


    -
    PHP Core:
    extension_dir /usr/lib/php5/20060613+lfs

    -
    extension_dir /usr/lib/php5/20060613



    edit2: , , +lfs - 15-20%, php4 .
    Last edited by ilko; 1st March 2008 at 05:09.

  8. #8
    Registered User
    Join Date: Oct:2008
    Location:
    Posts: 2
    Quote Originally Posted by ilko View Post
    php4* apt-get- .
    5- . wmware- , .
    phpinfo() .
    2, :

    Apache Environment:

    HTTP_PRAGMA no cache
    HTTP_CACHE_CONTROL no cache

    . .

    Skydive, ,

    edit: , ctrl+F5


    -
    PHP Core:
    extension_dir /usr/lib/php5/20060613+lfs

    -
    extension_dir /usr/lib/php5/20060613



    edit2: , , +lfs - 15-20%, php4 .
    . :
    1. ( )
    2. ( ) ( custom , ...)
    3. ... 500!!! ( )

    ...

    10

  9. #9
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    :
    http://forums.vtiger.com/viewtopic.php?t=18596

    php.ini , FAQ install FAQ .

    , , php4, php5 . 24 000 3 , , .
    ...

    VTiger .

    edit: 499 :
    http://forums.vtiger.com/viewtopic.php?t=5924&start=0
    http://forum.vtiger.com/viewtopic.ph...f1d9339d1414b7

    5.0.4 , 500 , 500, . 500 . ...
    Last edited by ilko; 5th October 2008 at 22:53.

  10. #10
    Registered User
    Join Date: Oct:2008
    Location:
    Posts: 2
    Quote Originally Posted by ilko View Post
    :
    http://forums.vtiger.com/viewtopic.php?t=18596

    php.ini , FAQ install FAQ .

    , , php4, php5 . 24 000 3 , , .
    ...

    VTiger .

    edit: 499 :
    http://forums.vtiger.com/viewtopic.php?t=5924&start=0
    http://forum.vtiger.com/viewtopic.ph...f1d9339d1414b7

    5.0.4 , 500 , 500, . 500 . ...
    ???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |