Dismiss Notice
You are browsing this site as a guest. It takes 2 minutes to CREATE AN ACCOUNT and less than 1 minute to LOGIN

Wataalamu wa PHP: Nisaidieni nimebrowse Internet YOTE!

Discussion in 'Tech, Gadgets & Science Forum' started by Given Edward, Aug 8, 2011.

  1. Given Edward

    Given Edward Verified User

    #1
    Aug 8, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    Kuna project nafanya na natumia PHP. napata error hii:

    Nisaidieni jamani nimesearch internet yoooote! Nawasilisha Wakuu.
     
  2. Kang

    Kang JF-Expert Member

    #2
    Aug 8, 2011
    Joined: Jun 24, 2008
    Messages: 4,698
    Likes Received: 203
    Trophy Points: 160
    PHP haioni hiyo file "Smarty.class.php" pia sidhani kama unatakiwa uweke address yake kihivyo yaani http://... nadhani inatakiwa iwe relative kama hiyo path ya config.php ulivyoiweka ila sina uhakika na hilo.
     
  3. Given Edward

    Given Edward Verified User

    #3
    Aug 8, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    So what should I DO?
     
  4. Kang

    Kang JF-Expert Member

    #4
    Aug 8, 2011
    Joined: Jun 24, 2008
    Messages: 4,698
    Likes Received: 203
    Trophy Points: 160
    Hakikisha file ipo, na ipo hapo unapopoint, kama ipo hapo badilisha hiyo path iwe kwenye format kama hiyo ya config.php yaani
    /home/..... Smarty.class.php
     
  5. Mtazamaji

    Mtazamaji JF-Expert Member

    #5
    Aug 8, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    Soma au tuwekee hapa file la na config .php line 30 ikoje ?


    Hilo file na specifically hiyo line ndio ina jibu la kitendawili chako

    kama ni line ina mambo ya db name, server name na password basi hakikisha ziko sawa


    Some websever hazikubali locahost zinataka uweke jina fulani
     
  6. HT

    HT JF-Expert Member

    #6
    Aug 8, 2011
    Joined: Jul 29, 2011
    Messages: 1,899
    Likes Received: 3
    Trophy Points: 0
    smarty ni templating framework. Una hakika imo ktk server yako? Halafu badala ya kufanyia remotely, kwa nini usifanyie locally ukimaliza ndio uzipandishe kwa server?
     
  7. Given Edward

    Given Edward Verified User

    #7
    Aug 8, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    Ngoja nilipandishe config.php mlione.
     
  8. Chamoto

    Chamoto JF-Expert Member

    #8
    Aug 9, 2011
    Joined: Dec 7, 2007
    Messages: 1,432
    Likes Received: 19
    Trophy Points: 135
    Nitatizo la path kama alivyosena Kang, katika server nyingi public_html folder hutumika kuweka makabrasha ya takayoonekana kwenye internet sasa unapo call http://darwap.site90.net/public_html/smarty/libs/Smarty.class.php unaiambia server ilete file ambalo halipo.

    Ila mbona hii site yako ( http://darwap.site90.net) inafanya phishing kwa ku-call site90.net, vipi bwana.
     
  9. Given Edward

    Given Edward Verified User

    #9
    Aug 13, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    Hii ndiyo config.php (nimeshindwa ku-upload)

    PHP:
    (include_path='.:/usr/lib/php:/usr/local/lib/php'<?
    error_reporting
    (E_ALL & ~E_NOTICE & ~E_WARNING);
    session_start();
    $config = array();
    $config['BASE_DIR']        =  '/home/darwap.site90.net/public_html';
    $config['BASE_URL']        =  'http://darwap.site90.net/install';
    $config['CONF_FILE']        =  $config['BASE_DIR'].'/include/conf.ini';
    $config['IMG_DIR']        =  $config['BASE_DIR'].'/images';
    $config['IMG_URL']        =  $config['BASE_URL'].'/images';
    $config['VDO_DIR']      =  $config['BASE_DIR'].'/video';
    $config['VDO_URL']      =  $config['BASE_URL'].'/video';
    $config['ADO_DIR']      =  $config['BASE_DIR'].'/audio';
    $config['ADO_URL']      =  $config['BASE_URL'].'/audio';
    $config['FLVDO_DIR']      =  $config['BASE_DIR'].'/flvideo';
    $config['FLVDO_URL']      =  $config['BASE_URL'].'/flvideo';
    $config['TMB_DIR']      =  $config['BASE_DIR'].'/thumb';
    $config['TMB_URL']      =  $config['BASE_URL'].'/thumb';
    $config['baseurl']      =  $config['BASE_URL'];
    $config['basedir']      =  $config['BASE_DIR'];
    $config['vdodir']       =  $config['VDO_DIR'];
    $config['vdourl']       =  $config['VDO_URL'];
    $config['audiodir']       =  $config['ADO_DIR'];
    $config['audiourl']       =  $config['ADO_URL'];
    $config['flvdodir']       =  $config['FLVDO_DIR'];
    $config['flvdourl']       =  $config['FLVDO_URL'];
    $config['imgurl']         =  $config['IMG_URL'];
    $config['imgpath']        =  $config['IMG_DIR'];
    $config['ffmpeg']       =   '';
    $config['guest_limite'] = 200;
    require_once(
    $config['BASE_DIR'].'/smarty/libs/Smarty.class.php');
    require_once(
    $config['BASE_DIR'].'/classes/mysmarty.class.php');
    require_once(
    $config['BASE_DIR'].'/classes/SConfig.php');
    require_once(
    $config['BASE_DIR'].'/classes/SError.php');
    require_once(
    $config['BASE_DIR'].'/include/adodb/adodb.inc.php');
    require_once(
    $config['BASE_DIR'].'/include/phpmailer/class.phpmailer.php');
    require_once(
    $config['BASE_DIR'].'/classes/SEmail.php');

    $DBTYPE 'mysql';
    $DBHOST SConfig::get("Database""host");
    $DBUSER SConfig::get("Database""user_name");
    $DBPASSWORD SConfig::get("Database""password");
    $DBNAME SConfig::get("Database""db_name");

    $conn = &ADONewConnection($DBTYPE);
    $conn->PConnect($DBHOST$DBUSER$DBPASSWORD$DBNAME);

    $sql "SELECT * from sconfig";
    $rsc $conn->Execute($sql);

    if(
    $rsc){while(!$rsc->EOF)
    {
    $field $rsc->fields['soption'];
    $config[$field] = $rsc->fields['svalue'];
    STemplate::assign($field$config[$field]);
    @
    $rsc->MoveNext();
    }}

    STemplate::assign('bgcolor','#E8E8E8');
    STemplate::assign('BASE_URL',       $config['BASE_URL']);
    STemplate::assign('BASE_DIR',       $config['BASE_DIR']);
    STemplate::assign('IMG_URL',        $config['IMG_URL']);
    STemplate::assign('baseurl',       $config['BASE_URL']);
    STemplate::assign('basedir',       $config['BASE_DIR']);
    STemplate::assign('imgurl',        $config['IMG_URL']);
    STemplate::assign('vdourl',        $config['VDO_URL']);
    STemplate::assign('adourl',        $config['ADO_URL']);
    STemplate::assign('flvdourl',       $config['FLVDO_URL']);
    STemplate::assign('tmburl',        $config['TMB_URL']);
    STemplate::setCompileDir($config['basedir']."/templates_c");
    STemplate::setTplDir($config['basedir']."/templates");
    ?>

    Site yenyewe ni http://darwap.site90.net/
     
  10. Mtazamaji

    Mtazamaji JF-Expert Member

    #10
    Aug 13, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    very challneging ngoja sijui wataalam wataupa ushauri gani ila nadhani BASE_DIR declaration kwenye line 5 inaweza kuwa ndio sababu. Sababu hizo value za BASE_ DIR ndio zinatumika kwenye line 30 31, 32 33, 34, 35, 36.

    Jaribu kusoma manual za hiyo smarty application kuhusu mambo ya absolute path na relative path . nadhani ndio hasa linaweza kuwa tatizo. na je umefuata maelekezo haya wakati unaisntall Quick Install | Smarty

    any way ngoja nami nijipe ractical challenge ya kufanya hiyo instalion kwa majiribio nione

    BTN
    naona site yako haionekani admin wanasema wanajaribu kuicheki kwa ama kuna suspicous stuff.
     
  11. Mtazamaji

    Mtazamaji JF-Expert Member

    #11
    Aug 13, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    Another problem inaweza kuwa kwenye line ya kwanza kabisa
    PHP:
    (include_path='.:/usr/lib/php:/usr/local/lib/php'<?
    Hizi ni mifano ya path na wana assume kuwa installation inafanyika kwenye local linux server. so kama installtion inafanyika kwenye remote online server zitafiti vizuri

    Je kwenye server yako hizo path na file zipo na zipo sawa?


    NB
    But na mimi najaribu kujifunza not fully coding person . u can see my signature. teh teh teh
     
  12. Kang

    Kang JF-Expert Member

    #12
    Aug 13, 2011
    Joined: Jun 24, 2008
    Messages: 4,698
    Likes Received: 203
    Trophy Points: 160
    Kweli hiyo line ya kwanza ina makosa, kwanza inaonekana haiko complete kisha sidhani kama inatakiwa kuwepo hapo, hii php file umeitoa wapi?
     
  13. Given Edward

    Given Edward Verified User

    #13
    Aug 13, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35

    So what should I do?
     
  14. Mtazamaji

    Mtazamaji JF-Expert Member

    #14
    Aug 13, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    au katika bahatisha bahati jaribu kedeclared line ya 5 iwe hivi

    PHP:
    $config['BASE_DIR']=  '.';
    Assumining smarty directory iko ndani ya public_html au root directry name yeyte kulingana na server yako

    Alafu unaweza kuweka site- directory structure ya hiyo smarty ilivyo

    eg public_ html directory ndani yake lina smarty directory, libs directory, etc

    na hii file la smarty.class.php iko katika path gani relative na home directory


    Ngoja nikacheki mpira. ukipata solution nifahamishe na mie nielimike php huwa inanipiga sana.
     
  15. Given Edward

    Given Edward Verified User

    #15
    Aug 13, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    Well, I want to build a youtube-like site so I took a script from somewhere kwenye net. Why?
     
  16. HT

    HT JF-Expert Member

    #16
    Aug 13, 2011
    Joined: Jul 29, 2011
    Messages: 1,899
    Likes Received: 3
    Trophy Points: 0
    given,
    nadhani ni vema ungeanza kuandika script yako, si kazi sana. Muda utakaopoteza ku debug hiyo script ni sawa na kuandika nyingine.
    Anyway,
    kama ukiamua kuendelea nayo ni kuwa smarty kama nilivyosema ni templating frramework ambayo ni separate package. Humo ndimo utakuta hilo faili. Download free ktk net (google rescues here).
    Sidhani kama naweza kwenda mabli kwa kuwa sijawahi kutumia smarty na sielewi modus operandi ya hiyo script yako in full,
    HT
     
  17. Kang

    Kang JF-Expert Member

    #17
    Aug 13, 2011
    Joined: Jun 24, 2008
    Messages: 4,698
    Likes Received: 203
    Trophy Points: 160
    Hiyo line ya kwanza doesn't look right at all, angalia kama inatakiwa.
     
  18. Given Edward

    Given Edward Verified User

    #18
    Aug 13, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    Wakuu nawashukuru sana! Let me put your suggestions to work. BRB (Be Right Back)
     
  19. Mtazamaji

    Mtazamaji JF-Expert Member

    #19
    Aug 13, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    Another option katika trial and error jaribu kubadilisha hii sbbau error uliyokuwa unapata mwanzo ina husiana na na line 30. na line 30 has something to do with BASE_ DIR declaration

    So badalaya ya line ya 5 kuwa hivi
    PHP:
    $config['BASE_DIR']        =  '/home/darwap.site90.net/public_html';
    Ifanye iwe hivi
    PHP:
    $config['BASE_DIR']        =  'home/a2313239/public_html';
    Hope a2313239 ndiyo FTP user name yako na hiyo ndiyo absolute path ya webserver space yako

    Ikisipoleta matokeo tofauti katika kutatua tatizo kuelewa wapi pa kukomalia jaribu ku comment line 30, 31, 32 33, 34, 35 na 36. Then run hiyo site hizo line zikiwa commented tuone. itatoa feedback gani?

    Line nazosema u comment kama hiyo ption ya juu isipoleta tofauti ni hizi
    PHP:
    // require_once($config['BASE_DIR'].'/smarty/libs/Smarty.class.php');
    // require_once($config['BASE_DIR'].'/classes/mysmarty.class.php');
    // require_once($config['BASE_DIR'].'/classes/SConfig.php');
    // require_once($config['BASE_DIR'].'/classes/SError.php');
    // require_once($config['BASE_DIR'].'/include/adodb/adodb.inc.php');
    // require_once($config['BASE_DIR'].'/include/phpmailer/class.phpmailer.php');
    // require_once($config['BASE_DIR'].'/classes/SEmail.php');
     
  20. Given Edward

    Given Edward Verified User

    #20
    Aug 14, 2011
    Joined: Jan 11, 2011
    Messages: 852
    Likes Received: 2
    Trophy Points: 35
    It worked!! Except sasa inaleta error on line 39. Can you give clues there?
     
Loading...