Jump to content

[SOLVED] Do google analytics module ruin prestashop?


Recommended Posts

Im not 100% sure but I think my webshop doesnt work after I activated the google analytics module.

I have tried to deactivate it without any luck, but maybe it have damage something else?

I can get access to the administration but the frontend is just loading and loading and then it times out.

Im running prestashop 1.3.1

I will pay if someone can fix it!

Link to comment
Share on other sites

That is strange.You tried to uninstall module, but nothing changed ?

First try to delete all files from tools/smarty/compile folder except index.php.

Then you can turn debug mode on change in config/config.inc.php

/* Debug only */
@ini_set('display_errors', 'on'); 


maybe some error will come up in back office.

Did you installed any other module ?

Link to comment
Share on other sites

Check write permission for /tools/smarty/compile and other folders like in installation process

PrestaShop folders have ‘write’ permissions (also known as “CHMOD 777” – explanation of file permissions here) but do not apply these permissions recursively (to their subfolders): /config, /upload, /download, /tools/smarty/compile. Then make sure the following folders have ‘write’ permissions and apply these permissions recursively (to their subfolders): /img, /mails, /modules, /themes/prestashop/lang, /translations


Just permissions should be 755.

Same error like in this topic.
Link to comment
Share on other sites

The problem was solved after i delete all of the files in the libary tools/smarty/compile except from index.php

There was like more than 1000 files I had to delete.

I was just wondering how do I this problem fix so it wont happen again ? is it a server setting I have to add or something like that?

Link to comment
Share on other sites

I'm not sure why it is a problem on your website, but not mine. The number of products shouldn't have an impact on how many PHP files are generated. I thought it was just one file for product.tpl. Are you frequently editing your TPL files?

I suppose you could create a cron job that deletes all the files except index.php in tools/smarty/compile. Create a file called cron.php in the root directory of your PrestaShop with the following:

<?php

include(dirname(__FILE__).'/../../config/config.inc.php');

if (isset($_GET['password']) AND $_GET['password'] == 'apassword')
{
  $files = scandir(_PS_ROOT_DIR_.'/tools/smarty/compile');

  foreach ($files as $file)
     if ($file != 'index.php')
        unlink(_PS_ROOT_DIR_.'/tools/smarty/compile/'.$file);
}

?>



Change 'apassword' to a password only you know so that only you can run the cron job, then create a cron job in your cPanel with a URL like http://www.yoursite.com/cron.php?password=apassword and set how often you want it to run. You can enter the URL directly into your browser to test the code first.

Link to comment
Share on other sites

I have changed the TPL files for like 1.5 months ago so I whould say im changing them alot.

But during the developement of the webshop I have been adding like 1000 products and at the same time been changing the tpl files.

But it sounds like a good idea with the cron job if that can keep the webshop running smoothly :)

Great tip!

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

The problem is solved (n4s, do you mind putting [sOLVED] in the topic name of your first post?).

It seems that new(er) versions of PrestaShop comes with the smarty settting:

$smarty->force_compile = true // to pass "false" when put into production


set to TRUE as default, which somehow - in our case - made Smarty generate thousands of tmp files.

Now, it might have something to do with the OPC module we've installed, since I guess most people would have known about this "bug" by now if it was a general issue.

Anyway, setting it to FALSE worked and Smarty no longer generates .tmp files and leaves them on the server.

On behalf on myself and N4S, thank you for helping us finding the error, which turned out to have nothing to do with Google Analytics. ;-)

Link to comment
Share on other sites

×
×
  • Create New...