SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smarty Template problem with Caching files

    I seem to be having a problem when I attempt to turn on caching:

    Code:
    Warning: mkdir() failed (Permission denied) in /usr/local/smarty/Smarty.class.php on line 1462
    
    Warning: Smarty error: problem creating directory "cache/183/1836865061" in /usr/local/smarty/Smarty.class.php on line 546
    
    Warning: Smarty error: problem writing 'cache/183/1836865061/N1025629230.php.' in /usr/local/smarty/Smarty.class.php on line 546
    the directory it is attempting to write to is templates_c/

    this directory has permissions: 777, the directory is owned by user and group nobody (same as webserver)

    although it is still giving me an error?
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  2. #2
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if I dont remember wrong you should have a directory called cache as well when you turn on caching.
    try to create it and chmod to 777 *check out configuration file for exact name for caching*

  3. #3
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this was correct. I needed a cache folder owned by nobody.nobody

    I also had to go into Smarty.class.php and turn on caching P

    Thank you!
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Location
    Planet Earth
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's better if you extend smarty with your own class where you override the values such as the cache / templates / templates_c rather than changing Smarty.class.php. This will make it easy for you to upgrade Smarty, or share Smarty for other applications.

    I love Smarty
    Fluid Hosting LLC - High Performance Web Presence
    New!! Virtual Private Server
    ICQ: 151540687 MSN: fluidhosting_jim@hotmail.com

  5. #5
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been starting to use it on all the sites i make now. It's so handy to seperate out all the processing.

    Does anyone have any large websites/database driven websites with smarty? If so can someone show their code. I am still trying to grasp certain aspects of smarty as it is very in depth.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •