Prestashop : SmartyException' with message 'unable to write file...' - permissions

I know this subject has already been covered, and if I come to ask for help here, it's because all the solutions I've found on the Internet didn't work for me.
The problem is the following :
I'm using Prestashop 1.6. I developed my website locally and everything worked just fine, so I decided to put it online. But after moving the database and the website on my FTP, I am encountering the following error :
Uncaught exception 'SmartyException' with message 'unable to write file /home/web/chienchat/cache/smarty/compile/wrt53fc8900660ea3.68556794' in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php:44
Stack trace:#0 /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/web/chien...', 'compileTemplateSource() #2 /home/web/chienchat/classes/module/Module.php(1860): Smarty_Internal_TemplateBase->fetch()#3 /home/web/chienchat/modules/blockuserinfo/blockuserinfo.php(72): ModuleCore->display('/home/web/chien...', 'blockuserinfo.t...')#4 /home/web/chienchat/classes/Hook.php(507): BlockUserInfo->hookDisplayTop(Array) #5 /home/web/chienchat/classes/controller/FrontController.php(444): HookCore::exec('displayTop') #6 /home/web/chienchat/controllers/front/IndexController.php(37): F in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44
I found it could be the file permissions, so for the sake of testing I've set CHMOD 777 on the whole www, by using FileZilla. The problem is still here.
I would like to point out that after deleting the cache/smarty folder, and after refreshing the non-working page, the folder cache/smarty/compile is anew created, but it is empty. Please help me, I can't seem to approach any solution.

The correct permission is 755. If this does not work try with 775.
Also the apache user must be the owner of the required folders.
The folders are listed here:
http://doc.prestashop.com/display/PS15/Installing+PrestaShop#InstallingPrestaShop-Systemcompatibility

This error can also occur if you use the filesystem cache. Many of the prestashop plugins are written in a way that causes a cache miss and store for lots of combinations of each page (page name, category name, language etc.) If you have a large number of products this can mean that you run over the Inode limit for the cache folder and you'll start to see this error, but only on first time visits to pages. Pages that were already in the cache will still render properly.
The solutions in this case are to
a) clear the cache
b) fix all the cache ids for every module
c) use an alternative caching strategy
A warning for c however - it doesn't fix the problem as the cache is still growing. It just takes away the filesystem limits on how many cache items you can hold. The best I can suggest for those suffering this problem is to automatically tail the log and clear the cache when this error occurs.

Related

MediaWiki: Getting "readapidenied" error instead of login token

That's a quite puzzling problem. I've multiple MediaWiki installations. In this specific case: Version 1.34.
Now I can login to all of these MediaWikis. Everything works fine.
Now I can access all of these MediaWikis via API --- EXCEPT ONE. The strange thing is: All of them are configured almost identical. I even copied the configuration from one wiki where everything was working to the second wiki.
To be more precise. If I send ...
/wikiA/api.php?action=query&meta=tokens&format=json&type=login
... I get a very reasonable answer, e.g.:
{"batchcomplete":"","query":{"tokens":{"logintoken":"37ec2e690eeb48a10ac66b2ccbca2b576000f9f4+\\"}}}
If I send ...
/wikiB/api.php?action=query&meta=tokens&format=json&type=login
... I get the following answer, e.g.:
{"error":{"code":"readapidenied","info":"You need read permission to use this module.","*":"See http://xxx.xxx.xxx.xxx/wikiB/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."}}
This can be reproduced using any web browser.
Q: What could be the reason that on this wikiB I even can't access the normal login module? It can't be the configuration. It's almost completely identical. It can't be the source code. I ran a diff on the PHP files and found no significant differences. What could be wrong here? It seems it must be something with the database. But how do I approach this? Does anyone have an idea? I would appreciate it very much if you could help!
I analyzed the data base: No difference. I did more research using google: And found a bug report.
It's a bug in MediaWiki. They provided an official software release with THAT kind of bug.
It turnes out there is a 1.34.0 version and a 1.34.1 version. My WikiA has 1.34.1 while WikiB had 1.34.0. After copying this one single file includes/api/ApiQuery.php from WikiA to WikiB and everything worked fine.
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/580097/

Slow OSClass based website issue since osclass.org is down?

I am using Osclass open source script for my classified ads website.
Since OSClass.org is down and OSClass market is closed my website site oc-admin speed is very slow, sometime oc-admin takes more than 40 seconds to login. Similarly oc-admin dashboard loads very slow.
What are causes of these issues and what should I do to get rid of these?
Github url is
https://github.com/osclass/Osclass
For security concerns I cannot put url of my website here.
I think this link solve your problem.
https://www.valueweb.gr/forums/osclass/for-osclass-3-8-remove-all-your-website-dependencies-from-osclass-org/
Blockquote
Stripped/nulled all Market connections and admin dashboard visuals from Osclass 3.8.
Here are the changed files only to remove Market connections. The structure is kept for your convenience. You just upload the two folders to replace 12 files.
If you prefer to do it manually here is the documentation:
https://docs.osclasscommunity.com/removing-market/introduction
Attachment: Osclass_380_Stripped_from_Market.zip

Can't upload new product image backend prestashop

I need a little help here, i hope someone here can help me for a hint or clue.
First of all, I'm not programmer. I'm just web admin who can use cms and basic html.
I was using PrestaShop for my online shop. In the backend, I can't upload new product image anymore.
The error just blank without any sign for me. Here for the screenshot:
I appreciate it, if someone can help me, thanks, and sorry for my english.
#PanjiWiyono This errors don't really give us a quality information, but this is a start. In your JS code should be a ajax query that has an error when converting results to json (first error). You should check what's the exact error that this request is returning by inspecting in browser developer console.
If you detect that the second error is in fact, the response of this ajax query, well now we almost have the problem.
The second error should be related to data size. Check this: Error while sending QUERY packet
Anyway, you should check DbPDO.php class. You can use debug_backtrace function to display the complete stack, but definitly if error is related to a basic PHP class issue you will have not help knowing wich classes are in calling stack.
Good luck.
Simple solution
maybe a extra module is in a conflict with the prestashop core files. go to advanced parameters, performance and disable third party modules and try again.
other option is reupload admin folder with other name and
js folder check again
hope it will work for you

IE11 - Getting a webpage to STOP showing in Enterprisemode

This is an odd question, in that I'm not trying to display a page in EnterpriseMode - I'm trying to prevent it from displaying in EnterpriseMode. I'm assisting the Webserver team, so my access is limited to only changes in the page itself.
The twist is that the rest of the domain has to be displayed in EnterpriseMode, save for this one page.
I've tried utilizing an XML document and changing HKLM\software\microsoft\internet explorer\main\enterprisemode -- setting SiteList to my file location on the local machine, and Enabled to blank. The page ignores this and loads itself into EnterpriseMode anyways.
Example of my Site.XML. Note: I've changed the server name to protect the innocent. Also I'm having to use the escape characters so the note quits trying to interact with my example. I could've sworn code block should've stopped that.
<rules version="1">
<emie>
<domain exclude="false">internalportal.ExampleServer.com<path exclude="true">/OperationsRecap/</path></domain>
</emie>
</rules>
I've tried the same thing in the HKCU key, and even checked gredit for anything that might be pushing it to default. No such luck. This should be a fairly simple procedure, but it's stumping me. I'm starting to wonder if the Webserver team has a customHeader stuck in web.config, but I don't have access and I've been waiting for an answer from them for a few days now. And by 'waiting' I mean 'continually hounding'.
Compatibility mode doesn't seem to make a difference, whether its on or off. I've several sites with different settings that get the same problem - and then several sites with different settings that do not get that problem. There does not appear to be a rhyme or reason in terms of configuration on the local machines. So while it's tempting to call it an issue with IIS7 web.config and dust my hands of the whole thing, I have to be absolutely certain.
I've dug at the source code, and literally the only difference is in the META tag. Those that load correctly load X-UA-Compatible as IE=Edge, like they're supposed too. Those that do not load as IE=8, despite all my attempts to force them to stop that. In fact, when it fails to load I can go to tools on the IE11, de-select EnterpriseMode, and it reloads just fine. The META tag changes as well in the source. Again, whether compatibility mode is on or off, whether there's a list in play, utterly ignoring any changes I make to EnterpriseMode key.
Thoughts?
Found the answer. I was looking in HKLM\software\microsoft\internet explorer\main\EnterpriseMode
I should have been looking in hklm\software\policies\microsoft\internet explorer\main\EnterpriseMode
Lesson learned, stupid mistake.

Is it possible for others to find images on my server that aren't referenced on my website?

If I upload a file to my webserver, is it possible for anyone or any crawler of some sort to find that file even though I haven't linked to it from anywhere or referenced to it?
Say for example you have a site that hides content to non logged in users, if I know the path to an image file I am able to reach that file even though I am not logged in. This is the case of several sites I regularly visit. But is this really a problem, is it possible for people with bad intentions to find these images even though they can't log in?
My next question would of course be (maybe that's another thread though): how can I as a web developer, using a LAMP stack, protect file paths from being requested from non logged in users?