SnippetMaster Support Forums

General => How To's & FAQs => Topic started by: admin on October 18, 2008, 04:36:14 AM



Title: How to edit a SNIPPET that contains more then 100kb of HTML code?
Post by: admin on October 18, 2008, 04:36:14 AM
SYMPTOM

- You have created a SNIPPET (http://www.snippetmaster.com/documentation/snippet-tags-basic-config.html) of html code (using Snippet Tags), but it is not appearing in the list of SNIPPETS in the "Select a file" dropdown selection box.

- The SNIPPET is very large and contains a lot of HTML code.  It is probably around the 100kb size or so...  (This might occur after pasting a large spreadsheet or text document, etc...)

PROBLEM
 
It could be the "pcre.backtrack_limit (http://docs.php.net/manual/en/pcre.configuration.php#ini.pcre.backtrack-limit)" PHP configuration setting on your web server.

Basically, what this setting does is set a size limit for certain PHP functions that Snippetmaster uses to "search" for the Snippet Tags inside your editable file. The size of the SNIPPET that can be found is limited to whatever is the value of this setting. (The default value of this setting is "100000", which is 100kb.)

To verify this is the problem, here is what you should do:

1. ) First, find out what is the size limit for your PHP software:
  • Go to http://www.yourdomain.com/snippetmaster/includes/diag/phpinfo.php
  • Press CTRL-F and search for "pcre.backtrack_limit".
  • Record the value of this setting under the "Local Value" column. For example, if it is "100000", then this means SnippetMaster will be automatically killed by your server when trying to find any SNIPPET that contains more then 100kb (100000 bytes) of html code.

2.) Second, find the "size" of the SNIPPET you inside the file you are trying to edit:
  • Open the editable file in a text editor.
  • Select the SNIPPET (including the Snippet Tags) and copy it to a new document. (Note: You must select only the SNIPPET and *not* the entire file.)
  • Use the "character count" function of your text editor to count the number of characters in the new document. If the number of characters in the SNIPPET is higher than the "pcre.backtrack_limit" value, then this is the problem.

RESOLUTION

To fix this problem, you need to modify the PHP configuration settings for your website. 

You must contact your web hosting provider and ask them to increase the "pcre.backtrack_limit" value located inside the php.ini file for your website. The new value for this setting should be (in bytes) whatever is the biggest size of SNIPPET html code you expect to edit. (ie: If you want to edit SNIPPETS that are 150kb in size, then you should set the value to "150000".)

If your web hosting provider is not willing (or capable) of making this change, then please let me know if you would like a recommendation for a good web hosting provider where you can get free licenses of SnippetMaster PRO (rebrandable version) with each account, as well as the best customer service and support you will ever find.

:)