====== Troubleshooting ====== ===== Does not count Hits ===== Traffic isn't being counted. Check these issues: 1. **DNS mismatch** - You're viewing server 1 in your browser but the domain is on server 2. Or your hosts file points to a different server. To verify: Create a test file (test.txt) on the server and access it from your browser to confirm you're on the correct server. 2. **Excessive caching** - The web server caches pages before they reach the script. When a request comes in, the server runs the script once, caches the result, then serves that cached version on future requests without running the script. No script execution = no hit counting. To check for caching: - Create log.txt in the domain root with 666 permissions - In common.php (in your domain root), add: `file_put_contents('/full_path_to/log.txt', date("H:i:s") . ':' . $_SERVER['HTTP_REFERER'], FILE_APPEND);` - Visit your domain from another one (you can add it as a trader) - Entries should appear in the log This also lets you verify that traffic is actually arriving, since sometimes traffic looks normal but isn't being counted. 3. You can enable debug out.php in the settings, open any page and look at the headers. There may be other signatures by which an idea of what's wrong might come. ===== Does not count CTR ===== **Version 2.X** First, verify that impressions are being counted. If there are no impressions, check: - **System traders** - In rotation settings, you may have "noref" or "notrade" traders that don't count traffic - **Proxy traffic** - All traffic might be detected as proxy (which isn't counted). Check the Home page for a proxy indicator - **Cache issues** - No cache (skip_cache in URL) or insufficient cache can lose impression data - **Cron domain** - Ensure you're passing the correct domain name when running cron **For clicks to count:** 1. Enable magic rotation OR ensure a rotation parameter is present in links. Options you can check yourself: **Magic rotation : Https - passing referrer** Magic rotation counts clicks relying on referrer, if it is not passed - rotation is not counted. How to check: [[troubleshooting#how_to_view_http_headers]] we look at click headers. Must pass **full** referer, not just truncated to the domain. What to do: Google "https passing referrer" - the question will be fully explained. Check for meta name="referrer" in your template # Meta tag: The meta referrer tag is placed in the section of your HTML, and references one of five states, which control how browsers send referrer information from your site. The five states are: 1. None: Never pass referral data 2. None When Downgrade: Sends referrer information to secure HTTPS sites, but not insecure HTTP sites 3. Origin Only: Sends the scheme, host, and port (basically, the subdomain) stripped of the full URL as a referrer, i.e. https://moz.com/example.html would simply send https://moz.com 4. Origin When Cross-Origin: Sends the full URL as the referrer when the target has the same scheme, host, and port (i.e. subdomain) regardless if it's HTTP or HTTPS, while sending origin-only referral information to external sites. (note: There is a typo in the official spec. Future versions should be "origin-when-cross-origin") 5. Unsafe URL: Always passes the URL string as a referrer. Note if you have any sensitive information contained in your URL, this isn't the safest option. By default, URL fragments, username, and password are automatically stripped out. "Magic rotation - skip_cache" often a page is tested with the skip_cache parameter, in this case it won't count clicks, because clicks are saved in cache until cron and in this case they simply don't write. What to do: test without skip_cache **Rotation parameter** if you count clicks through a rotation parameter and you have rewrites, then the rewrites might be configured so that the rotation parameter is not passed. How to check: make links without rewrite, enable headers [[troubleshooting#how_to_view_http_headers]] - there should be Click-count-action headers. If without rewrite they are there, but with rewrite they are not - this means the problem is that the rewrite doesn't pass parameters. What to do: fix the rewrites so they pass the ref. **Version 1.X** First you need to check that impressions are being counted. If there are no impressions - 99% there is no rot_in.php in the page templates. If there are only no clicks - check that the gallery links have a rotation parameter like 12x34x5678. If it's there too - the problem might be in the rewrites. To check you need to click on any thumb and check the headers (If you don't know what these are or how to check them - [[Troubleshooting]] section about headers). If there are no fields like Set-Cookie in the headers - it means the rewrites bypass out.php. Check the rewrites, compare with what's in the wiki. For version 50+: * might be that you only have noref traffic for example and in rotation settings clicks counting for this traffic is disabled. * might be that clicks counting from proxies is disabled, and nginx is incorrectly configured and determines all traffic as proxy [[Nginx]] ===== Rewrites does not work ===== There might also be a variant "skim doesn't work right", "URLs don't work", etc. Currently the 2 most common web servers are nginx and Apache. Rewrites are written differently in them. Probably you wrote rewrites in .htaccess although you have nginx. You can check this simply by looking at headers of any request, you will see a line like Server: nginx or Server: Apache/2..... ===== Does not show navigation ===== Problem: we have some page with 2 tags:
2. open as scj/tube/?force_template=test if there are no entries then we check * are sponsors\groups active * are galleries active * and, hit, are you looking at the right host, have never encountered that in hosts one thing, domain on another server, etc ===== Tube Embeded Switch Rules does not work ===== Usually it looks like this: a link like out.php?url=http://domain/gallery/slug/index.html and it's supposed to work when you click on this link. But when you click on it the out doesn't know which tube this gallery is from because to understand that you need to process the rewrite (which Apache does) and find out the gallery slug, and then search for it in the database. By default this option works with direct links like http://domain/gallery/slug/index.html because here it enters the script immediately after the rewrite, which passes the slug What to do: 1. simple option make links like out.php?slug=....&url=http://domain/gallery/slug/index.html so the script will get slug 2. complex: if you don't want to change the URLs then in common.php parse your rewrite and set $_GET['slug'] = ... , then the script will again get the slug when clicking ===== Tag \ template does not work ===== In most cases the template has a lot of everything except the actual tags\macros of the script, and understanding what's there, where rewrites are, how everything is built - takes a lot of time (if it's possible at all without hours of conversations about what where how and why it was done). So if something doesn't work you need to do the following. * create a test template, for example test * add script tags\macros there, certainly in clean form, for example, if you have in the template something like and here 15 lines of html with PHP insertions then for the test template this needs to be changed to for example or some specific tag that doesn't work the point of action is to get the most clean template, without styles, overlays, popups, etc - only script tags. * open the test template with the parameters you need, for example http://domain/?slug=...**&force_template=test** * if you see the problem in the test template - it means the problem is in the script, send support the admin, the link with the test template and description of what exactly is wrong there * if everything is ok in the test - it means the problem is somewhere in your html\php. For this you start adding your code to the test template in pieces until the error appears. In 99% of cases by this point you will already understand what the reason is. * transfer script tags to the test template until you manage to reproduce the problem, then it will be clear what exactly the problem is, and if in the script - then it will be clear what specifically to fix ===== CURL Timeout ===== When grabbing files curl downloads them (not the script), the message in the log is like Curl error: Operation timed out after. Default timeout for curl - 30 seconds. This is done so that some site can't intentionally "tie up grabbing" by delivering one file for 3 days conditionally. You can raise the timeout time for yourself. To do this in config.php you need to add $config['CURLOPT_TIMEOUT'] = 60000; this is 60 seconds.