• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1208
  • Last Modified:

PHP error message

I.m getting the following error php error:
PHP Warning: Smarty::include(include/smarty/templates_c\%%45^45E^45E480CD%%index.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.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\includes;C:\Inetpub\wwwroot\WEBPORTAL\include\smarty') in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1258

// the index.php file is:
<?php
require_once('c:/Inetpub/wwwroot/WEBPORTAL/include/smarty/Smarty.class.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','Ned');
//** un-comment the following line to show the debug console
$smarty->debugging = true;
$smarty->display('index.tpl');
?>

// the index.tpl

<html>
<head>
<title>Smarty</title>
</head>
<body>
Hello, {$name}!
</body>
</html>
0
erwingosepa
Asked:
erwingosepa
  • 5
  • 3
1 Solution
 
Vel EousResearch & Development ManagerCommented:
The warning is informing you that the file "index.tpl.php" cannont be found in that directory.

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.
0
 
erwingosepaAuthor Commented:
Now I'm getting the following:
PHP Warning: Smary error: unable to read resource: "index.tpl" in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1095

the index.tpl is in the templates directory.

0
 
m1tk4Commented:
Redefine compile_dir as global (i.e. based of C:/).
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
erwingosepaAuthor Commented:
Redefine compile_dir as global (i.e. based of C:/). does not work.
0
 
erwingosepaAuthor Commented:
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?
0
 
m1tk4Commented:
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.
0
 
erwingosepaAuthor Commented:
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.
0
 
erwingosepaAuthor Commented:
This is the eror that I get now. the debugging is set to true.

PHP Warning: Smarty::include(c:/Inetpub/wwwroot/WEBPORTAL/include/smarty/templates_c/\%%6D^6D7^6D7C5625%%test.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1258 PHP Warning: Smarty::include() [function.include]: Failed opening 'c:/Inetpub/wwwroot/WEBPORTAL/include/smarty/templates_c/\%%6D^6D7^6D7C5625%%test.tpl.php' for inclusion (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1258 PHP Warning: Smarty::include(c:/Inetpub/wwwroot/WEBPORTAL/include/smarty/templates_c/\%%5F^5FE^5FE30B84%%debug.tpl.php) [function.Smarty-include]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1925 PHP Warning: Smarty::include() [function.include]: Failed opening 'c:/Inetpub/wwwroot/WEBPORTAL/include/smarty/templates_c/\%%5F^5FE^5FE30B84%%debug.tpl.php' for inclusion (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\WEBPORTAL\include\smarty\Smarty.class.php on line 1925
0
 
m1tk4Commented:
You need to check the directory in Windows Explorer for the permissions to [SERVERNAME]_IUSR user, not only in IIS. Second - are the files Smarty is trying to include actually there (i.e. in /smarty/templates_c...)?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now