Wednesday, May 13, 2009

Unable to find the socket transport “ssl” - maybe you forget to enable it when you configured PHP?

1. yum install openssl

2.php install

'./configure' '--with-openssl' '--with-imap-ssl'

php smarty submenu

require_once("MySmarty.class.php");
$o_smarty = new MySmarty();


$o_smarty->caching = false;
$o_smarty->cache_lifetime = 3600*168;
if (!$o_smarty->is_cached('top.tpl')) {



$menu=array (
0=>array (
0=>"aaaa",
1=>"adsa",
),
1=>array (
0=>"bbbb",
1=>"dasas",
2=>"sadas",
),
2=>array (
0=>"cccc",
1=>"asdasddsa",
)
);
$o_smarty->assign('menu',$menu);


}//if (!$o_smarty->is_cached('top.tpl'))


$o_smarty->display("testmenu.tpl");

?>



{foreach item=bmenu from=$menu name=bmenu}

{foreach item=smenu from=$bmenu name=smenu}
{if $smarty.foreach.smenu.index==0}

{$smenu}



    {else}
  • {$smenu}

  • {/if}
    {/foreach}


{/foreach}

postgresql select distinct with random

select distinct categoryid FROM search_random where categoryid in(select categoryid from search_random order by random() limit 8) limit 4

ERROR: pgsenna2: sen_index_update failed

postgres.conf
・ludia.max_n_sort_result = 100000
・ludia.enable_seqscan = on
・ludia_sen_index_flags = 31
・ludia.max_n_index_cache = 16
・ludia.initial_n_segments = 3000

setting up with big value initial_n_segments it will pass error

postgresql order by count

select count(*), u.user_id
from aaa up
join user u
on u.user_id=up.user_id
where accepted=1
group by user_id
having count(*)>1
order by 1