erwingosepa
asked on
PHP error message
I.m getting the following error php error:
PHP Warning: Smarty::include(include/sm arty/templ ates_c\%%4 5^45E^45E4 80CD%%inde x.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1258 PHP Warning: Smarty::include() [function.include]: Failed opening 'include/smarty/templates_ c\%%45^45E ^45E480CD% %index.tpl .php' for inclusion (include_path='.;c:\php\in cludes;C:\ Inetpub\ww wroot\WEBP ORTAL\incl ude\smarty ') in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1258
// the index.php file is:
<?php
require_once('c:/Inetpub/w wwroot/WEB PORTAL/inc lude/smart y/Smarty.c lass.php') ;
$smarty = new Smarty();
$smarty->template_dir = 'include/smarty/templates' ;
$smarty->compile_dir = 'include/smarty/templates_ c';
$smarty->cache_dir = 'include/smarty/cache';
$smarty->config_dir = 'include/smarty/configs';
$smarty->assign('name','Ne d');
//** un-comment the following line to show the debug console
$smarty->debugging = true;
$smarty->display('index.tp l');
?>
// the index.tpl
<html>
<head>
<title>Smarty</title>
</head>
<body>
Hello, {$name}!
</body>
</html>
PHP Warning: Smarty::include(include/sm
// the index.php file is:
<?php
require_once('c:/Inetpub/w
$smarty = new Smarty();
$smarty->template_dir = 'include/smarty/templates'
$smarty->compile_dir = 'include/smarty/templates_
$smarty->cache_dir = 'include/smarty/cache';
$smarty->config_dir = 'include/smarty/configs';
$smarty->assign('name','Ne
//** un-comment the following line to show the debug console
$smarty->debugging = true;
$smarty->display('index.tp
?>
// the index.tpl
<html>
<head>
<title>Smarty</title>
</head>
<body>
Hello, {$name}!
</body>
</html>
ASKER
Now I'm getting the following:
PHP Warning: Smary error: unable to read resource: "index.tpl" in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1095
the index.tpl is in the templates directory.
PHP Warning: Smary error: unable to read resource: "index.tpl" in C:\Inetpub\wwwroot\WEBPORT
the index.tpl is in the templates directory.
Redefine compile_dir as global (i.e. based of C:/).
ASKER
Redefine compile_dir as global (i.e. based of C:/). does not work.
ASKER
Tchuki:The warning is informing you that the file "index.tpl.php" cannont be found in that directory.
The file in the directory is "index.tpl" not index.tpl.php.
Where is taking the "index.tpl.php" then?
The file in the directory is "index.tpl" not index.tpl.php.
Where is taking the "index.tpl.php" then?
index.tpl is your original Smarty template. The warning shows that it can't find the COMPILED template that is created by Smarty in your .../templates_c directory. Compiled templates are actually PHP files, and Smarty creates a random name and appends .php to it.
It could be as easy as the compile directory not being set as writeable by your webserver - hence Smarty can't compile your tpl and then include the compiled .php.
It could be as easy as the compile directory not being set as writeable by your webserver - hence Smarty can't compile your tpl and then include the compiled .php.
ASKER
if the statement mention above is true then I have problems with compiling. I checked the the directory in IIS and it has read and write permissions.
ASKER
This is the eror that I get now. the debugging is set to true.
PHP Warning: Smarty::include(c:/Inetpub /wwwroot/W EBPORTAL/i nclude/sma rty/templa tes_c/\%%6 D^6D7^6D7C 5625%%test .tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1258 PHP Warning: Smarty::include() [function.include]: Failed opening 'c:/Inetpub/wwwroot/WEBPOR TAL/includ e/smarty/t emplates_c /\%%6D^6D7 ^6D7C5625% %test.tpl. php' for inclusion (include_path='.;C:\php5\p ear') in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1258 PHP Warning: Smarty::include(c:/Inetpub /wwwroot/W EBPORTAL/i nclude/sma rty/templa tes_c/\%%5 F^5FE^5FE3 0B84%%debu g.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1925 PHP Warning: Smarty::include() [function.include]: Failed opening 'c:/Inetpub/wwwroot/WEBPOR TAL/includ e/smarty/t emplates_c /\%%5F^5FE ^5FE30B84% %debug.tpl .php' for inclusion (include_path='.;C:\php5\p ear') in C:\Inetpub\wwwroot\WEBPORT AL\include \smarty\Sm arty.class .php on line 1925
PHP Warning: Smarty::include(c:/Inetpub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your page is named index.tpl, but somewhere in your code (perhaps on another page) instead of including index.tpl, you are trying to include "index.tpl.php".
Check the file named Smarty.class.php and look in line 1258. That is where the error is pointing you to.