Jump to content

Fatal Error - unable to write file...


Recommended Posts

cart was working fine, all i did was changed hosts, setup db, change db setup, etc...

 

now I get this:

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/abcshop/public_html/cache/smarty/compile/wrt50cd13e78d4ec9.43840100' in /home/abcshop/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/abcshop/public_html/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/abcshop/p...', '<?php /* Smarty...', Object(Smarty)) #1 /home/abcshop/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /home/abcshop/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('/home/abcshop/p...', NULL, NULL, NULL, true) #3 /home/abcshop/public_html/classes/controller/Controller.php(354): Smarty_Internal_TemplateBase->display('/home/abcshop/p...') #4 /home/abcshop/public_html/classes/controller/FrontController.php(615): ControllerCore->smartyOutputContent('/home/abcshop/p...') #5 /home/abcsh in /home/abcshop/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44

 

Any ideas?

 

Thanks

 

[resolved] dir permissions set wrong on new host.

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

  • 5 months later...
  • 3 months later...

Hey guys,

 

I just moved from a shared host to a vps server and I was having the same problem as you,

 

I found changing the permissions on cache/smarty/cache & cache/smarty/compile to 777 corrected this error for me, I'm not sure if setting it to 777 is the greatest idea though, can somebody confirm what the permissions to these folders should be?

Link to comment
Share on other sites

 

 

I found changing the permissions on cache/smarty/cache & cache/smarty/compile to 777 corrected this error for me, I'm not sure if setting it to 777 is the greatest idea though, can somebody confirm what the permissions to these folders should be?

it isn't great idea especially when you're on shared host. VPS isn't simple hosting, it's a  virtual machine. Anyway, you should change directories to 755 and files to 644

 

+ make sure that you have correct CHOWN for these files / directories

Link to comment
Share on other sites

  • 6 months later...

it isn't great idea especially when you're on shared host. VPS isn't simple hosting, it's a  virtual machine. Anyway, you should change directories to 755 and files to 644

 

+ make sure that you have correct CHOWN for these files / directories

Thanks Vekia for your support.

Could you suggest also the correct CHOWN forr these file/directories, please?

 

Thanks again

Link to comment
Share on other sites

  • 3 months later...

hello

several days ago one of my customer had the same problem.

where the problem was?

 

in server settings.

they had limitations related to number of files stored on the hosting account.

 

cache generates large amount of files, so he exceeded this limit

and error you mentioned appeared for him.

 

perhaps you've got the same problem?

Link to comment
Share on other sites

  • 3 months later...

buenos días,

soy nuevo en esto y necesito ayuda 

cuando entro en  mi pagina me sale el siguiente error:

Fatal error: Uncaught --> Smarty: unable to write file /home/a3733367/public_html/cache/smarty/cache/blocknewproducts_tab/20141026/3/1/6/8f/e4/b4/wrt544ca1ef9bcd48_46097981 <-- thrown in/home/a3733367/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46

Link to comment
Share on other sites

hi ,

In your BO -> Go To ADVANCED PARAMETERS --> PERFORMANCE

then at Template compilation Choose : Force compilation

Then you turn Cache to NO

Press : Clear Cache

if this is done change the abouve settings back

 

Also check your configuration  :

 


In your BO -> Go To ADVANCED PARAMETERS --> CONFIGURATION INFORMATION 

then look to :  CHECK YOUR CONFIGURATION

is this ok or Do you see : Required parameters Please fix the following error(s)

Link to comment
Share on other sites

it isn't great idea especially when you're on shared host. VPS isn't simple hosting, it's a  virtual machine. Anyway, you should change directories to 755 and files to 644

 

+ make sure that you have correct CHOWN for these files / directories

Hi Vekia ,

somewhere  it is  sometimes real strange on shared hosting

then you need to have some folders and sub folders at 777 otherwise the shop doesn't run

had already several clients who had problems with this ,,

also with regenerating the htaccess it is sometimes to give it 777 right

and after regenerating you can turn it back into 644 

otherwise it is not possible to regenerate ,, 

have seen this already since ps. 1.2  <perhaps it is just the dutch shared hosting  :D )

Link to comment
Share on other sites

no puedo entrar en el panel de administración

 

te dejo la url www:lavalldolca.com

Hi this is the English forum so if you can please english

 

but to solve your problem 

check your rights 

 

go with ftp to the folder Cache

give the folder and subfolder 777 rights

 

does this work for you ?

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

problem from Arbona is Solved

the problem was the htaccess was corrupt

folder smarty with subfolders not correct 

also the server had strange problems with connecting the database 

downloaded settings.inc.php and edited this one with notepad ++ 

 

after this site is running again

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

hello ,

            we Have the same issue on lastest prestashop version & change the 777 rights folder and subfolder  also did nt solved the issue

 PHP Warning:  touch(): Utime failed: Permission denied in /public_html/tools/smarty/sysplugins/smarty_internal_template.php on line 192 PHP Fatal error:  Uncaught  --> Smarty: unable to write file public_html/cache/smarty/compile/00/0a/58/wrt54610a535cf919_07130393 <--   thrown in /home/pacman/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46
Link to comment
Share on other sites

one should 'never' have to run 777...

 

most often times the problem is with file ownership...i.e. your domain is not owner of files (see chgrp).  this can be for a wide variety of reasons, i.e. unzipping to domain and not ftp'ed with that domains ftp credentials, using ssh...3rd party installer...creation of domain...and silly hosting

 

note on a lot of hosting today 777, is dis-allowed because the permission is to 'high', and it is...

Link to comment
Share on other sites

one should 'never' have to run 777...

 

most often times the problem is with file ownership...i.e. your domain is not owner of files (see chgrp).  this can be for a wide variety of reasons, i.e. unzipping to domain and not ftp'ed with that domains ftp credentials, using ssh...3rd party installer...creation of domain...and silly hosting

 

note on a lot of hosting today 777, is dis-allowed because the permission is to 'high', and it is...

Hi El ,

True !!

 

but sometimes for debugging it is helpfull :-) to switch to 777 and after it is up and running again back to 755

 

on the other hand i have checked / installed shops on several servers ,

spain , france , belgium , netherlands , china etc and several times

prestashop was screaming for 777 ,, especially with installing , 755 or even 775 776 didn't help 

and was not possible to get it working ,,

after 777 it did work and when the shop was up and running in some cases i could go back to 755

but in some cases some folders it needed 777 

so it is real server related i tnink

Link to comment
Share on other sites

Hi El ,

True !!

 

but sometimes for debugging it is helpfull :-) to switch to 777 and after it is up and running again back to 755

 

on the other hand i have checked / installed shops on several servers ,

spain , france , belgium , netherlands , china etc and several times

prestashop was screaming for 777 ,, especially with installing , 755 or even 775 776 didn't help 

and was not possible to get it working ,,

after 777 it did work and when the shop was up and running in some cases i could go back to 755

but in some cases some folders it needed 777 

so it is real server related i tnink

 

yes, learning about group/ownership will be helpful in the future...now drop and give me 50 

  • Like 1
Link to comment
Share on other sites

 

hello ,

            we Have the same issue on lastest prestashop version & change the 777 rights folder and subfolder  also did nt solved the issue

 PHP Warning:  touch(): Utime failed: Permission denied in /public_html/tools/smarty/sysplugins/smarty_internal_template.php on line 192 PHP Fatal error:  Uncaught  --> Smarty: unable to write file public_html/cache/smarty/compile/00/0a/58/wrt54610a535cf919_07130393 <--   thrown in /home/pacman/public_html/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46

in this case , go to your hosting log in ,, go to the files -> cache -> smarty ->compile , and check the GID <owner> probably it is on apache  if so , g back to the folder compile choose this one and choose reset owner

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi all!

 

I am having similar problems with my site (in a local machine). I have readed the thread and seems to be a similar problem. My error says:

Fatal error: Uncaught --> Smarty: unable to write file C:\xampp\htdocs\Tienda/cache/smarty/compile\fc\02\29\fc0229fae4110a573f9462423cca470600aed88c.file.product-list.tpl.php <-- thrown in C:\xampp\htdocs\Tienda\tools\smarty\sysplugins\smarty_internal_write_file.php on line 74

 

I have no experience or idea about the permissions you are talking about. How should I change them? By the way, can you recomend me some tutorial to read about them? Are those server permissions?

I don't understand why  the slash and backslash mixing in the path shown in the error. Could it be another problem?

 

As you see I am quite newbie on this, so any advice will be welcome.

 

Mmmm... Looking at the internet, it seems that those permisions you refer to are unix/linux system permissions. But I am working under windows XP, with XAMPP. So maybe mine is a different problem

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

  • 3 months later...
hi ,

In your BO -> Go To ADVANCED PARAMETERS --> PERFORMANCE

then at Template compilation Choose : Force compilation

Then you turn Cache to NO

Press : Clear Cache

if this is done change the abouve settings back

 

 

Can't access backoffice though, given 777 permission to cache and smarty folders , what else ?

 

Regards

Link to comment
Share on other sites

  • 1 month later...

+ make sure that you have correct CHOWN for these files / directories

Hi Vekia,

What IS the correct chownfor the prestashop folder? I'm assuming the following

- root the owner of the prestashop folder and all contents (except for the files that prestashop/apache generates)

- owner/group/public read permissions on the prestashop folder and all contents (so apache can do it's stuff)

- owner/group/public write permissions for certain folders (e.g. https://gist.github.com/alexsegura/9650651)

 

Does that sound right?

 

Is there someplace in the prestashop docs where this is spelled out completely?

 

Thanks!

Ed Eichman

Cambrils, Spain

Link to comment
Share on other sites

  • 2 months later...

Hello guys,

 

I have similar problem.

 

In front of website and also everywhere is just blank page and on BO page too.

 

i get this errror:

on front website

Fatal error: Uncaught --> Smarty: unable to write file /home/ra678411/www_root/cache/smarty/compile/22/7c/d6/wrt599d9dbda17f05_83336677 <-- thrown in /home/ra678411/www_root/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46

 

on BO page
Fatal error: Uncaught --> Smarty: unable to write file /home/ra678411/www_root/cache/smarty/compile/11/4e/89/wrt559dd670b7e178_19679554 <-- thrown in /home/ra678411/www_root/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46

 

- using PS 1.6.0.9, and hosting server

- My folders cache/smarty/cache/  and cache/smarty/compile are empty, cause i deleted their content manualy, and index.php is still there

- permisions of these folders i set to 777 (btw is thi safe and right, cause in different tutorials I found suggestions not to do it)

- my FTP is full of around 11GB but on server I have allowed 30GB, so there is enough space (and this problem was also when on FTP was just 5GB)

(btw, this fatal error i get after above folders clearing, before that site worked, but much of product pages showed just blank pages and in BO much of functions (mostly system default) went also to blank page)

 

 

Could somebody tell me what can I do to fix it please?

 

Thank you in advance.

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

  • 2 months later...

Hello all,

 

I'm starting with Prestashop so please be a little patient. :)

 

The error message "tools/smarty/sysplugins/smarty_internal_write_file.php on line 46" points to the code that creates a new directory and it fails when writing is not allowed. Clear so far.

In my case the owner of cache/smarty/compile is the FTP-User but the directories created by smarty are owned by an other user with permission 771. I can not change permissions of that directories. (A Demoshop I set up for my customer - FreeBSD-Server with PHP 5.5 - runs fine, but on the machine of customer - Ubuntu-Linux with PHP 5.4 - does not)

As I can not access the BO is there any chance to handle this manually? Is there any setting somewhere in a file that deals with owner?

 

Thanks a lot in advance

Mon

Edited by fraubauer (see edit history)
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...