Jump to content

PHP Fatal error: Uncaught --> Smarty: unable to write file (Even permission is set to 777) ?


munvera

Recommended Posts

I have set the file permission to 777 but I am still getting this error. Help!  :unsure:

 

PHP Fatal error: Uncaught --> Smarty: unable to write file /home3/schuhste/public_html/cache/smarty/compile/a5/48/f2/a548f208f6cfeb9396c66f4dcd84405b5e6efafc.file.maintenance.tpl.php <--
thrown in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 74

 

 

Link to comment
Share on other sites

Is there any other errors or is this the only error you see?

Check if the file is there or not, if it is there, you can try to delete this file manually to see if it can deleted.

 

/home3/schuhste/public_html/cache/smarty/compile/a5/48/f2/a548f208f6cfeb9396c66f4dcd84405b5e6efafc.file.maintenance.tpl.php

 

If there is no such file and there are also some other files, then it might be file/folder permission or ownership problem.

 

You may try following file and folder permission

folder: 755

file: 644

 

If it still have problem, you may need to contact hosting service provider, it could be related to file/folder ownership related issues.

Link to comment
Share on other sites

Other errors:

 

PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/home3/schuhste/public_html/cache/smarty/cache/homefeatured/1/1/1/245/00): failed to open dir: No such file or directory' in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php:196

 

PHP Warning: file_get_contents(/home3/schuhste/public_html/cache/smarty/compile/28/e7/0c/28e70c1d878b88cae15cbc6d75c06c1b75c45dcd.file.column.tpl.php): failed to open stream: No such file or directory in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php on line 156

 

PHP Fatal error: Uncaught --> Smarty: Invalid compiled template for '/home3/schuhste/public_html/themes/autumn/modules/blocktopmenu/blocktopmenu.tpl' <--
thrown in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php on line 182

 

Sometimes my site loads well, sometimes it prompts Error 500. 

 

I have set Never clear cache files, but it seems my smarty cache still auto flush?

Link to comment
Share on other sites

Some time the issue also happens when multiple user access concurrently, if your smarty cache is disable, it tried to update the file but it was used by other user.

 

 

I have set Never clear cache files, but it seems my smarty cache still auto flush?

 

 

you also need to set following option too.
 
Template compilationNever recompile template files
Link to comment
Share on other sites

Here's another error.

 

PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/home3/schuhste/public_html/cache/smarty/compile/6b/f2/78): failed to open dir: No such file or directory' in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_utility.php:242
Stack trace:
#0 [internal function]: RecursiveDirectoryIterator->__construct('/home3/schuhste...', 0)
#1 /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_utility.php(242): RecursiveDirectoryIterator->getChildren()
#2 /home3/schuhste/public_html/tools/smarty/Smarty.class.php(1469): Smarty_Internal_Utility::clearCompiledTemplate(NULL, NULL, NULL, Object(SmartyCustom))
#3 /home3/schuhste/public_html/classes/SmartyCustom.php(104): Smarty->clearCompiledTemplate()
#4 /home3/schuhste/public_html/classes/SmartyCustom.php(123): SmartyCustomCore->check_compile_cache_invalidation()
#5 /home3/schuhste/public_html/classes/module/Module.php(2270): SmartyCustomCore->createTemplate('/home3/schuhste...', NULL, NULL, Ob in /home3/schuhste/public_html/tools/smarty/sysplugins/smarty_internal_utility.php on line 242

 

Oh my god! My site is down several times a day!  :(  :(  :(

 

I have set never recompile template files

Link to comment
Share on other sites

  • 3 months later...

I have the same problem, Someone that help us? Urgeeent!!

 

I don't remember how I solved it, because I tried every suggested solutions found in this forum and suddenly the problem solved.

 

One of the steps I tried was setting the file permission, folder 755 and file 644. I changed the permission of every single folder and file, one by one.  :unsure:

Plus, my hosting server had some problem previously which causes my site to down several a day. 

 

Hope this helps. 

Edited by munvera (see edit history)
Link to comment
Share on other sites

you may also check if the file/folders owner group is the same with other ones.

if you have changed user for web application (server setting, not your store setting), you may face the same issue, because the user is not the owner, no matter what permission you set. you may consult with your service provider support to see if they can give you more information.

Link to comment
Share on other sites

  • 6 years later...

In my project the problem was that I had an ajax request like the following

static getTemplate(successFunction, errorFunction){
        $.ajax({
            url: ADMIN_CONTROLLER_URL,
            cache: false,
            dataType: 'json',
            method: 'POST',
            data: {
                ajax:true,
                controller:"AdminControllerName",
                action: 'getNewFilterTemplate',
            },
            success: function (response) {
                if(!response.success){
                    errorFunction(response);
                    return;
                }

                successFunction(response);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                errorFunction();
            }
        });
    }

to an AdminController method like so

public function ajaxProcessGetNewFilterTemplate() { 
	echo json_encode(["success" => true, "template" => $this->getFiltersTemplate()]); 
	die(); 
}

However there was an error in the front end setting the event listenner 2 times and then making 2 ajax requests.

For some reason Chrome only showed one call and that was the request response that i had from my controller.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...