Monday, January 23, 2012

Prestashop blank front office or failed to open stream

Today's tip is a real problem that may waste lots and lots of time to just find where the error is !! Prestashop is a php cms that is used to develop E-Commerce websites. Hosting prestashop on a linux/apache server will cause no problem at all, but hosting it on a Windows server causes some problems.
you may find your Prestashop Back Office working properly but front office is Blank !! this problem happens because of Folder and File Permissions.





First steps to do are :
1- from plesk user interface, open your file manager.
2- on the root you will find a folder called httpdocs. This folder contains your site's files ... open it.
3- go to config and open the file "config.inc.php".
4- search for:  @ini_set('display_errors', 'off');
5- replace 'off' by 'on'
6- go back to your website's front office, now you can see where actually the error is, because errors will appear to you in this page.

Now we know where is the error ... how will we fix it ?? actually fixing this issue is very easy.
let's assume that the error is :
Warning: Smarty::include([SERVER-PATH]\httpdocs\plinthes/tools/smarty/compile\%�^B17^B17F1E91%%header.tpl.php) [smarty.include]: failed to open stream: No such file or directory in D:\inetpub\vhosts\plinthes-chauffantes.fr\httpdocs\plinthes\tools\smarty\Smarty.class.php on line 1259


so it needs permission on the ( SMARTY ) folder.


fixing this issue is very easy following the upcoming steps:
1-
in Plesk administration panel, list the site directories and files for your website, scroll to [YOUR-SHOP-ROOT]/tools/, select the smarty directory. Click on the "locker" icon on the right side of the screen.
2-  when Plesk lists the "users", for each of them you can set the permissions to "total control" (which include modify, read & execute, list the directory contents, read, write.)
3- The users are as follows : (unless you previously added roles or specific users):
- System
- Administrator
- Plesk IIS User (IUSRxxx) ( The "user" for all other page requests, an anonymous access account which is used by IIS to access pages on the site for incoming requests )
- Plesk IIS WP User (IWPDxxx) (The ASP.NET "user")
- Plesk Domain User (xxx) (the user to login to access the account in Plesk or by FTP)
- FPSE User : If you use FrontPage.

4- click on every user and allow for it ( Full Control ).
5- Click OK , and now go to your front end, refresh ... and that's it


P.S : if after finishing these steps it thrown another error with another file, go repeat the previous steps on that file, giving it the same permissions, and your website will work properly.

No comments:

Post a Comment