View previous topic :: View next topic |
Author |
Message |
specccarl Smarty Rookie
Joined: 17 Jun 2008 Posts: 5
|
Posted: Tue Jun 17, 2008 2:53 am Post subject: Need help... |
|
|
Hi there.My problem is still have smarty error althought i have included path in php.ini,set smarty path is apache config file and i do set the absolute path for smarty in my index.php.Don't know why i still have the smarty error.Anyone pls enlight me?
Best regards
Specccarl. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jun 17, 2008 4:48 am Post subject: |
|
|
Which error message do you get? |
|
Back to top |
|
specccarl Smarty Rookie
Joined: 17 Jun 2008 Posts: 5
|
Posted: Wed Jun 18, 2008 7:46 pm Post subject: |
|
|
First thank for your help,and this is my error:
[ERRNO: 2
TEXT: unlink(C:\hatshop\presentation\templates_c\%%45^45E^45E480CD%%index.tpl.php) [function.unlink]: No such file or directory
LOCATION: C:\hatshop\libs\smarty\internals\core.write_file.php, line 44, at June 19, 2008, 3:46 am
Showing backtrace:
unlink("C:\hatshop\presentation\templates_c\%%45^45E^45E480CD%%index.tpl...") # line 44, file: C:\hatshop\libs\smarty\internals\core.write_file.php
smarty_core_write_file(Array[3], Object: Page) # line 29, file: C:\hatshop\libs\smarty\internals\core.write_compiled_resource.php
smarty_core_write_compiled_resource(Array[2], Object: Page) # line 1430, file: C:\hatshop\libs\smarty\Smarty.class.php
Smarty._compile_resource("index.tpl", "C:\hatshop\presentation\templates_c\%%45^45E^45E480CD%%index.tpl...") # line 1253, file: C:\hatshop\libs\smarty\Smarty.class.php
Smarty.fetch("index.tpl", null, null, true) # line 1105, file: C:\hatshop\libs\smarty\Smarty.class.php
Smarty.display("index.tpl") # line 11, file: C:\hatshop\index.php]
Please I need your help,Thanks!
Best regards,
Specccarl |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jun 18, 2008 8:12 pm Post subject: |
|
|
I think the configration parameter §smarty->compile_dir and $smarty->cache_dir do not point to the rigth location. Use an absolute path to the loaction where the Smarty subfolders template_c and cache are located. |
|
Back to top |
|
timrw Smarty n00b
Joined: 20 Jun 2008 Posts: 1
|
Posted: Fri Jun 20, 2008 12:42 pm Post subject: |
|
|
Apparently there is a bug in the current release of Smarty. I was advised to try this with the same problem, and it worked...
Hack the code of Smarty, by editing
\libs\smarty\internals\core.write_file.php at line 44, by adding this code:
---> if (file_exists($params['filename']))
---> {
@unlink($params['filename']);
---> }
Good luck |
|
Back to top |
|
specccarl Smarty Rookie
Joined: 17 Jun 2008 Posts: 5
|
Posted: Fri Jun 20, 2008 4:53 pm Post subject: |
|
|
U.Tews wrote: | I think the configration parameter §smarty->compile_dir and $smarty->cache_dir do not point to the rigth location. Use an absolute path to the loaction where the Smarty subfolders template_c and cache are located. |
Thanks for you help,I really appreciated your help,anyway I do set a absolute path file to template_c in index.php,but it's not work.Anyway I have another question,My question is I do not have a cache folder,do you thnik this possible which caused the error?
Best regards,
Specccarl. |
|
Back to top |
|
specccarl Smarty Rookie
Joined: 17 Jun 2008 Posts: 5
|
Posted: Fri Jun 20, 2008 4:56 pm Post subject: |
|
|
timrw wrote: | Apparently there is a bug in the current release of Smarty. I was advised to try this with the same problem, and it worked...
Hack the code of Smarty, by editing
\libs\smarty\internals\core.write_file.php at line 44, by adding this code:
---> if (file_exists($params['filename']))
---> {
@unlink($params['filename']);
---> }
Good luck |
Hi Tim,thank for your advise,er......so are you sure editing the smarty code wouldn't trigger any error?
Best regards,
Specccarl |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Jun 20, 2008 5:30 pm Post subject: |
|
|
Normally @unlink should not create an error message. However it looks like that in some cases this doesn't work when a custom error handler is used. You can give it a try with the modification.
As long as you do not enable caching you do not need to define cache_dir. |
|
Back to top |
|
specccarl Smarty Rookie
Joined: 17 Jun 2008 Posts: 5
|
Posted: Sun Jun 22, 2008 5:08 pm Post subject: |
|
|
After I try with the modification,I get the HTTP 500 internal server error,Its don't even show the smarty error,anyone please help?
Best regards,
Specccarl. |
|
Back to top |
|
gokufast Smarty n00b
Joined: 26 Nov 2008 Posts: 1
|
Posted: Wed Nov 26, 2008 10:40 pm Post subject: |
|
|
timrw wrote: | Apparently there is a bug in the current release of Smarty. I was advised to try this with the same problem, and it worked...
Hack the code of Smarty, by editing
\libs\smarty\internals\core.write_file.php at line 44, by adding this code:
---> if (file_exists($params['filename']))
---> {
@unlink($params['filename']);
---> }
Good luck |
so what version of smarty is free of this error? |
|
Back to top |
|
nedo Smarty Rookie
Joined: 30 Mar 2012 Posts: 8
|
Posted: Fri Mar 30, 2012 7:22 pm Post subject: |
|
|
m facing the same problem in my code ...,and i do'nt knw dt what should i do now ..., its my final year project ... and m very plz help me |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Mar 30, 2012 7:50 pm Post subject: |
|
|
Which version of Smarty do you use? |
|
Back to top |
|
nedo Smarty Rookie
Joined: 30 Mar 2012 Posts: 8
|
Posted: Sat Mar 31, 2012 6:15 am Post subject: |
|
|
version of smarty is Smarty-2.6.26 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Mar 31, 2012 6:52 am Post subject: |
|
|
The error message you are receiving is normally suprressed by the @ operator.
Does your application set up a custom error handler by set_error_handler()?
Note that custom error handlers gets called also on errors which should be suppressed by the @ operator. In this case the $errno paramter of the handler has the value 0 and you must exit the handler with false like
Code: | if ($errno == 0) return false; |
See http://php.net/manual/en/function.set-error-handler.php |
|
Back to top |
|
nedo Smarty Rookie
Joined: 30 Mar 2012 Posts: 8
|
Posted: Sat Mar 31, 2012 7:28 am Post subject: |
|
|
ERRNO: 512
TEXT: Smarty error: unable to read resource: "departments_list.tpl"
LOCATION: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php, line 1093, at March 31, 2012, 7:09 am
Showing backtrace:
trigger_error("Smarty error: unable to read resource: "departments_list.tpl"", "512") # line 1093, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty.trigger_error("unable to read resource: "departments_list.tpl"") # line 1589, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty._fetch_resource_info(Array[3]) # line 1415, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty._compile_resource("departments_list.tpl", "F:/wamp/www/hatshop/presentation/templates_c\%%A5^A5A^A5A1C73D%%...") # line 1867, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty._smarty_include(Array[2]) # line 18, file: F:\wamp\www\hatshop\presentation\templates_c\%%45^45E^45E480CD%%index.tpl.php
include("F:\wamp\www\hatshop\presentation\templates_c\%%45^45E^45E480CD%%...") # line 1256, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty.fetch("index.tpl", null, null, true) # line 1106, file: F:\wamp\www\hatshop\libs\smarty\Smarty.class.php
Smarty.display("index.tpl") # line 7, file: F:\wamp\www\hatshop\index.php
{* departments_list.tpl *}
{load_departments_list assign="departments_list"}
{* Start departments list *}
<div class="left_box" id="departments_box">
<p>Choose a Department</p>
<ol>
{* Loop through the list of departments *}
{section name=i loop=$departments_list->mDepartments}
{assign var=selected_d value=""}
{* Verify if the department is selected to decide what CSS style
to use *}
{if ($departments_list->mSelectedDepartment ==
$departments_list->mDepartments[i].department_id)}
{assign var=selected_d value="class=\"selected\""}
{/if}
<li>
{* Generate a link for a new department in the list *}
<a {$selected_d}
href="{$departments_list->mDepartments[i].link|escape:"html"}">
» {$departments_list->mDepartments[i].name}
</a>
</li>
{/section}
</ol>
</div>
{* End departments list *} |
|
Back to top |
|
|