PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, April 14, 2022

[FIXED] How to fix error "Fatal error: Uncaught --> Smarty: unable to write file"?

 April 14, 2022     migration, permissions, php, prestashop, smarty     No comments   

Issue

I migrated Prestashop from localhost to website domain using digitalocean, but when I open this website I get this error

Fatal error: Uncaught --> Smarty: unable to write file /var/www/html/prestashop/cache/smarty/compile/a4/36/f1/wrt549a35e49b3b44_77591243 <-- thrown in /var/www/html/prestashop/tools/smarty/sysplugins/smarty_internal_write_file.php on line 46.

I tried to change permissions on the smarty folder to 755, but it didn't work. I don't know how to fix it.


Solution

You problem is definitely about permissions. It depends on how Apache and PHP are set up.

First, check who owns the folders. For example, simple apache2 and php installation runs as www-data user. For example, if you connected to FTP with 'user1' and uploaded your files there, then the files are owned by you. The group is probably also set to 'user1'.

Therefore, you can modify, write the files, but PHP processes cannot, because they dont own the files (PHP runs as www-data, for example).

Your best bet is to contact server administrator and ask him to help you out.

Rememeber: never set 777 for any files/folders on a website, solve the problem the correct way.



Answered By - gskema
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing