Results 1 to 3 of 3

Thread: WAMP server - Problem

  1. #1
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy WAMP server - Problem

    Ok...so i'm new to this one....be gentle please

    I got wamp 2.0 server, i install it, follow the steps very easy until here also...made some modification in php.ini and in httpd.conf

    The icon from the wamp server it's white and the services are running

    Now the tricky part
    I have a functionally site and i got also his data base.

    I copy the site files in the directory C:\wamp\www\bbbb(made a folder)

    In phpMyadmin i created a new user (same as the one from db.php
    Code:
    <?
    function openCN($dsn='zzzzz:*****@localhost/bbbbb'){
     ereg('^([^:]+):([^@]+)@([^/]+)/([^\\/:*?."<>|]+)$',$dsn,$regs) or die('invalid dsn format');
     @mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
     @mysql_select_db($regs[4]) or die('no such database');
     mysql_query( "SET CHARACTER SET 'utf8'" );
    }
    ) and a data base with the same name. I imported the data base and everything it's fine until here.

    But when i type in my local browser http://localhost/bbbb in my browser window it displays:
    Code:
    |]+)$',$dsn,$regs) or die('invalid dsn format'); @mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
    @mysql_select_db($regs[4]) or die('no such database');
    mysql_query( "SET CHARACTER SET 'utf8'" ); } function closeCN(){ mysql_close(); } function sqlInsert($t,$a){ if(!is_array($a))return(FALSE);
    $s=NULL; foreach($a as $k=>$v){ if($s){$s.=",";$s2.=",";}else{$s="INSERT INTO `$t`(";$s2="";} $s.="`$k`";if($v===NULL)$s2.="NULL";else $s2.="'".addslashes($v)."'"; } 
    return("$s) VALUES($s2)"); } function sqlUpdate($t,$a){ if(!is_array($a))return(FALSE); $s=NULL; foreach($a as $k=>$v){ if($s)$s.=",";else $s="UPDATE `$t` SET "; $s.="`$k`=";if($v===NULL)$s.="NULL";else $s.="'".addslashes($v)."'"; } return($s); } ?>$val){ if($qs=='')$qs='?';else $qs.='&'; $qs.=$key.'='.$val; } return substr($_SERVER[PHP_SELF],strrpos($_SERVER[PHP_SELF],'/')+1).$qs; } function strBegin($s,$l=125){ if(strlen($s)>$l){ $s=substr($s,0,$l);
     $s=substr($s,0,strrpos($s,' ')); $s.=' [...]'; } return $s; } function r_HTML($s,$l=NULL){ if($l!==NULL)$s=$l.'/'.$s; $tpl=new tpl($s);
     return $tpl->get(); } function r_TXT($s){ /* $s=htmlspecialchars($s); $s=str_replace('<b>','',$s); $s=str_replace('<B>','',$s); $s=str_replace('</b>','',$s); $s=str_replace('</B>','',$s); */ $s=ereg_replace('[_a-zA-z0-9\-]+(\.[_a-zA-z0-9\-]+)*\@[_a-zA-z0-9\-]+(\.[a-zA-z]{1,6})+','\\0',$s); $s=nl2br($s); return $s; } function r_IMG($i,&$w,&$h,$u=NULL,$t=NULL){ global $g_strLang,$g_arrPreload; $imagesize=@getimagesize($i); $w=NULL; if($imagesize===FALSE)return NULL; list($width,$height,$type,$attr)=$imagesize; 
    if(NULL===$u)$s=''; else{ $s=''; $g_arrPreload[]=str_replace('.','_.',$i); } $w=$width; $h=$height; return $s; } function r_MEDIA($i,$w=NULL,$h=NULL,$bg=NULL){ if(eregi(".(jpg|jpeg|gif)$",$i)){ if((NULL===$w)&&(NULL===$h)){ $imagesize=@getimagesize($i); list($w,$h,$type,$attr)=$imagesize; } return(''); } 
    if(eregi(".swf$",$i)){ if((NULL===$w)&&(NULL===$h)){
    From the Apache error.log i have the following:
    Code:
    [Fri Feb 22 09:18:09 2008] [error] [client 127.0.0.1] File does not exist:
    C:/wamp/www/bbbb/'.$i.', referer: http://localhost/bbbb/
    And also from php eror.log i have:
    Code:
    [22-Feb-2008 09:18:09] PHP Fatal error:  Call to undefined function openCN() in
    C:\wamp\www\bbbb\index.php on line 27
    To mentioned that in the file index.php on line 27 i have
    Code:
    openCN();

    any help???

    Thanks,

  2. #2
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Finlay i figure it out

    The site use short_open_tag
    Code:
    <?.............?>
    so if anyone has the same problem in php.ini find the line
    Code:
    short_open_tag=off
    and replace off with on

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Or... you could just replace <? with <?php and it'll be fine, regardless of what server you use.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

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