Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
need help
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 4:34 pm    Post subject: need help Reply with quote

i get error log all i get is a blank page when i try to go to my site can anybody help please here is the log

[21-Feb-2012 15:38:16 UTC] PHP Warning: require(slibs/Smarty.class.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home2/thedugou/public_html/config/startup.php on line 8
[21-Feb-2012 15:38:16 UTC] PHP Warning: require(slibs/Smarty.class.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home2/thedugou/public_html/config/startup.php on line 8
[21-Feb-2012 15:38:16 UTC] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'slibs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/thedugou/public_html/config/startup.php on line 8
[21-Feb-2012 15:48:33 UTC] PHP Warning: require(slibs/Smarty.class.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home2/thedugou/public_html/config/startup.php on line 8
[21-Feb-2012 15:48:33 UTC] PHP Warning: require(slibs/Smarty.class.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home2/thedugou/public_html/config/startup.php on line 8
[21-Feb-2012 15:48:33 UTC] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'slibs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/thedugou/public_html/config/startup.php on line 8
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 4:58 pm    Post subject: Reply with quote

in startup.php you must have something like:

Code:
require('slibs/Smarty.class.php');



and it is unable to load smarty because it cannot find the class. that looks like a relative path, be sure your php include_path has the path to where the slibs directory resides, or supply a full path to the require().
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 5:36 pm    Post subject: Reply with quote

thx for quick reply im still haveing trouble this is the warning i get now
Warning: require(slibs/Smarty.class.php) [function.require]: failed to open stream: No such file or directory in /home/u193378798/public_html/config/startup.php on line 8

Fatal error: require() [function.require]: Failed opening required 'slibs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u193378798/public_html/config/startup.php on line 8
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 5:37 pm    Post subject: Reply with quote

minky67 wrote:
thx for quick reply im still haveing trouble this is the warning i get now
Warning: require(slibs/Smarty.class.php) [function.require]: failed to open stream: No such file or directory in /home/u193378798/public_html/config/startup.php on line 8

Fatal error: require() [function.require]: Failed opening required 'slibs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u193378798/public_html/config/startup.php on line 8


Yes, exactly what I stated above. This is a pretty basic PHP error.
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 5:44 pm    Post subject: Reply with quote

Thx for the help this is all new to me but im slowley getting there ill keep you posted on my progress.
thx again
mark Very Happy
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 5:48 pm    Post subject: Reply with quote

check this here:

http://php.net/manual/en/function.include.php
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 5:55 pm    Post subject: Reply with quote

Still struggling big time this is my startup php im not sure what part i have to change

require('slibs/Smarty.class.php');

//initialize smarty templating engine
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = true;

//initialize mysql class
$db = new Database($config['server'], $config['user'], $config['pass'], $config['database'], "");
$db->connect();

//require game engine classes
require_once("classes/class.team.php");
require_once("classes/class.player.php");
require_once("classes/class.fixture.php");
require_once("classes/class.schedule.php");
require_once("classes/class.table.php");
require_once("classes/class.result.php");
require_once("classes/class.report.php");
require_once("classes/class.score.php");
require_once("classes/class.fresult.php");
require_once("classes/class.freport.php");
require_once("classes/class.fscore.php");
require_once("classes/class.stadium.php");
require_once("classes/class.settings.php");
require_once("classes/class.manager.php");
require_once("classes/class.finance.php");
require_once("classes/class.user.php");

if ($_SESSION['uid'] != "") {
$user = new user_class($_SESSION['uid']);
$sql = "update `ma_user` set `lastlogin`=".time()." where id=".$user->id;
$db->query($sql);
}

/*$l = $_GET['l'];
if (isset($l))
{
if ($_SESSION['uid'] != "")
{
$sql = "update `ma_user` set `lan`=$l where `id`=".$_SESSION['uid'];
$db->query($sql);
}
$lang = $l;
$_SESSION['lann'] = $l;
}
else
{
if ($_SESSION['uid'] != "")
{
$sql = "select `lan` from `ma_user` where `id`=".$_SESSION['uid'];
$tmp = $db->query_first($sql);
$_SESSION['lann'] = $tmp['lan'];
}
if (isset($_SESSION['lann']))
{
$lang = $_SESSION['lann'];
}
else
{
$lang = 0;
}
}*/
$lang = 0;

require_once("config/lan_".$lang.".php");
$smarty->assign("LAN", $lan);
?>
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 6:01 pm    Post subject: Reply with quote

Code:
Fatal error: require() [function.require]: Failed opening required 'slibs/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u193378798/public_html/config/startup.php on line 8


This means on line 8 of startup.php an attempt to require the 'slibs/Smaty.class.php' file failed. So, first find out where the slibs directory resides on your file system, and of course be sure Smarty.class.php is in there. Then figure out why the require() did not work. Most likely, the include_path does not include the directory where slibs resides. You could also fix this specific problem with a full path:

require('/full/system/filepath/to/slibs/Smarty.class.php');

fill in the bold part with the real system path.
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 6:09 pm    Post subject: Reply with quote

That worked but now i get this error so im getting there slowly

Fatal error: Class 'Smarty' not found in /home/u193378798/public_html/config/startup.php on line 11
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 7:41 pm    Post subject: Reply with quote

You must not have loaded the Smarty.class.php file before instantiating Smarty.

// MUST TO THIS FIRST
require('slibs/Smarty.class.php');

// NOW THIS WILL WORK
$smarty = new Smarty;
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 7:48 pm    Post subject: Reply with quote

this is how it looks now

<?php
session_start();
/**
* @copyright 2008 Slash Web Design
*/
require_once("config/config.php");
require_once("classes/class.database.php");
require('http://the-dugout.ux1.eu/admin/slibs/Smarty.class.php');

//initialize smarty templating engine
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = true;

//initialize mysql class
$db = new Database($config['server'], $config['user'], $config['pass'], $config['database'], "");
$db->connect();
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 7:52 pm    Post subject: Reply with quote

Code:
require('http://the-dugout.ux1.eu/admin/slibs/Smarty.class.php');


This must be a LOCAL SYSTEM file path not a URL.
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 7:58 pm    Post subject: Reply with quote

So that would be

require('/admin/slibs/Smarty.class.php');
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7274
Location: Lincoln Nebraska, USA

PostPosted: Tue Feb 21, 2012 8:03 pm    Post subject: Reply with quote

is /admin/ at the root of your filesystem? I'm willing to bet it is something like /home/u193378798/public_html/.../admin/... or somewhere in there. Check your filesystem.
Back to top
View user's profile Send private message Visit poster's website
minky67
Smarty Rookie


Joined: 21 Feb 2012
Posts: 13

PostPosted: Tue Feb 21, 2012 8:07 pm    Post subject: Reply with quote

I seem to be getting a little further now i seem to be getting datbase problems

the link to my site

http://the-dugout.ux1.eu/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Help Wanted (commercial) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP