troubleshooting
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| troubleshooting [2024/05/27 08:45] – [Server setup error, apache\nginx is running with user permissions - Warning] admin | troubleshooting [2026/03/21 10:12] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Troubleshooting ====== | ||
| + | |||
| + | ===== It doesn' | ||
| + | |||
| + | We're happy to help, but please provide clear details. In most cases, quick resolution depends on: | ||
| + | |||
| + | * Make sure you're running the latest version—your issue may already be fixed | ||
| + | * Check the troubleshooting section and FAQ first | ||
| + | * Describe exactly what's not working (URL, menu path, etc.) | ||
| + | * Share what you see (error messages, warnings, exact output) | ||
| + | * Explain what you expected to happen | ||
| + | |||
| + | The more detail you provide, the faster we can help! | ||
| + | |||
| + | ===== Page does not show ===== | ||
| + | |||
| + | A blank/white page usually means PHP error reporting is disabled in php.ini. Enable error reporting to see the actual error messages. | ||
| + | |||
| + | |||
| + | ===== Test template ===== | ||
| + | |||
| + | Templates often contain many elements—tags, | ||
| + | |||
| + | When something fails, create a minimal test template with only the problematic element. For example, if you suspect the < | ||
| + | |||
| + | < | ||
| + | <thumb num=1-10> | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | That's it, nothing extra, easy to understand which gallery doesn' | ||
| + | ===== Does not count traffic ===== | ||
| + | |||
| + | |||
| + | 1. Check if cron works. Home tab. If there' | ||
| + | If there is this text, it means someone deleted our cron task. | ||
| + | You need to write a line like this to run every minute | ||
| + | |||
| + | cd / | ||
| + | |||
| + | |||
| + | 2. If you use SmartCJ index.php make sure there are no other index files in the same directory, for example index.html. | ||
| + | Depending on server settings by default when requesting URL | ||
| + | http:// | ||
| + | it can take the index.php or index.shtml or index.html file etc. That is if the directory has index.html - the server loads it instead of index.php (SmartCJ file), i.e. the Smart script doesn' | ||
| + | |||
| + | |||
| + | ===== How to view HTTP headers ===== | ||
| + | |||
| + | |||
| + | This is also a way to see where an external rotator redirects you, for example. | ||
| + | Since each click goes through many rules - the only way to know why it redirects here and not there - is the headers. | ||
| + | So in the HTTP protocol, roughly speaking, there' | ||
| + | 99% of all redirects happen using the Location header. When the browser receives such a header from the server it immediately goes to the specified URL. | ||
| + | |||
| + | So to see where the script redirects you, you need to see the headers. This is done as follows (there are many options, but I think this is the simplest and requires minimum effort): | ||
| + | - In settings - other enable out.php debug (Yes) (wait a minute) | ||
| + | - set Cookie Engine = Regular cookie | ||
| + | - If you don't have it installed yet, download and install FireFox | ||
| + | - Press Tools-Add-ons (Tools-addons), | ||
| + | - Open your site in FF, from the Tools menu run Live HTTP Headers. A new window will open showing all headers. You click on any link and can watch how requests from you to the server run in this window. You need to find lines like | ||
| + | |||
| + | Location: http:// | ||
| + | |||
| + | this is the redirect. | ||
| + | |||
| + | So also in the headers there can be strings like Current-Click: | ||
| + | |||
| + | ===== SmartCJ doesn' | ||
| + | |||
| + | 2 options: | ||
| + | |||
| + | **1. if you use include for click counting** | ||
| + | |||
| + | It's very easy to check. If you use include.php rename it to include_scj.php and create a file include.php with the following content | ||
| + | |||
| + | <?php | ||
| + | $f = fopen(' | ||
| + | fputs($f, date(' | ||
| + | fclose($f); | ||
| + | include(' | ||
| + | |||
| + | then create a log.txt file and chmod it 666 | ||
| + | |||
| + | The script is very simple, it just writes referrers to a file. Set the script for an hour or day as you like and at the end of this period download the file to Excel and sort it - it will be easier to count how many hits were from the needed referrer and accordingly how many hits were from the needed domain. | ||
| + | |||
| + | **2. if you use Smart' | ||
| + | * create a log.txt file in the root and chmod 666 it | ||
| + | * rename the original index (SmartCJ index.php) to index_scj.php | ||
| + | * create index.php with the following content | ||
| + | |||
| + | <?php | ||
| + | $f = fopen(' | ||
| + | fputs($f, date(' | ||
| + | fclose($f); | ||
| + | include(' | ||
| + | |||
| + | |||
| + | Done. | ||
| + | The script is very simple, it just writes referrers to a file. Set the script for an hour or day as you like and at the end of this period download the file to Excel and sort it - it will be easier to count how many hits were from the needed referrer and accordingly how many hits were from the needed domain. | ||
| + | |||
| + | **If you need to count the number of CLICKS** everything is almost the same. | ||
| + | |||
| + | * rename Smart' | ||
| + | * create log.txt there and 666 permissions on it | ||
| + | * create out.php with the following content | ||
| + | < | ||
| + | <?php | ||
| + | |||
| + | if ($_COOKIE[' | ||
| + | $f = fopen(' | ||
| + | fputs($f, date(' | ||
| + | fclose($f); | ||
| + | } | ||
| + | |||
| + | include(' | ||
| + | |||
| + | </ | ||
| + | |||
| + | where **trader.com** is accordingly the needed trader. | ||
| + | |||
| + | then just look at the number of lines in the log file for the selected time period. | ||
| + | |||
| + | ===== All clicks are counted as nocookie. ===== | ||
| + | |||
| + | A: Clicks are counted by cookies. On IN the user gets a cookie that records which trader they came from. On clicks this cookie is read and the corresponding trader gets a click. If the script can't read the cookie when clicking (it's not there) - the script records such clicks as nocookie. | ||
| + | |||
| + | The technology of cookies is such that if a cookie was set on a page on the domain www.asd.com, | ||
| + | |||
| + | What this means in our situation: if a surfer came to your page | ||
| + | http:// | ||
| + | and the link to out | ||
| + | http:// | ||
| + | (i.e. without www), then cookies will NOT be passed to out and clicks will be counted as nocookie. To avoid this you need to make all links to out relative. | ||
| + | |||
| + | <a href=' | ||
| + | <a href='/ | ||
| + | |||
| + | |||
| + | There are special cases, for example : | ||
| + | The trader has a Personal Page set. The trader sends you as | ||
| + | http:// | ||
| + | , and in Personal Page it says | ||
| + | http:// | ||
| + | , i.e. the cookie is lost. To avoid this it's better to specify the personal page as a path i.e. just trader.html (without http:/ | ||
| + | |||
| + | |||
| + | ===== It redirects somewhere | ||
| + | |||
| + | You need to enable in Settings - Debug out.php, click on the right link and see the headers (how to do this is described above). | ||
| + | Usually by the headers it's clear what's happening. If it's not clear - create a topic on the forum with headers, we'll figure it out. | ||
| + | |||
| + | ===== It counts 3 times more traffic then I actually have ===== | ||
| + | |||
| + | I often encounter the following situation: with web server errors (403, 404) it redirects to the domain root. When a picture is missing on the index the browser loads instead of the missing picture - the index, so we get 2 ins instead of one visit. | ||
| + | |||
| + | Option 2: the Smart index is on the root. At the same time in [[CJ Pages]] the same index is also specified, it turns out that the index includes itself. | ||
| + | |||
| + | |||
| + | In any case, it's easy to check this. | ||
| + | |||
| + | 1. make a test template where just a line " | ||
| + | 2. open the site as domain/? | ||
| + | 3. make sure that in the hit counting log there' | ||
| + | 4. move to the test template piece by piece what you have in the index until you notice it counts 2 times | ||
| + | ===== All traders are marked as banned by uribl.com ===== | ||
| + | |||
| + | Most likely the problem is in the server' | ||
| + | The script checks for presence of this service ban (http:// | ||
| + | host -tA trader.com.multi.uribl.com | ||
| + | |||
| + | If the domain is not in the database the service should answer something like | ||
| + | |||
| + | Host trader.com.multi.uribl.com not found: 3(NXDOMAIN) | ||
| + | |||
| + | If you get "can not connect" | ||
| + | |||
| + | |||
| + | |||
| + | ===== It doesn' | ||
| + | |||
| + | |||
| + | Check very simply: all parts of the script that work with traffic include the common.php file accordingly you can add a small simple code to this file that will log all script requests to a text file. | ||
| + | |||
| + | * create a log.txt file and 666 permissions for it | ||
| + | * in common.php after <?php add the following code | ||
| + | |||
| + | < | ||
| + | $f = fopen(' | ||
| + | fputs($f, date(' | ||
| + | fclose($f); | ||
| + | </ | ||
| + | |||
| + | |||
| + | Done. As you can see 3 lines in the script, there' | ||
| + | |||
| + | |||
| + | ===== It doesn' | ||
| + | |||
| + | Now Google loves sites more that are signed with a certificate (https). The question of trading is that by default when switching from https to http the referrer is not transmitted, | ||
| + | |||
| + | In this situation there are 2 solutions: | ||
| + | |||
| + | - add and send traders with ID. That is, if you have an https site then you add traders as http:// | ||
| + | - Or add <meta tag that will tell the browser that in a specific situation the referrer should be transmitted. | ||
| + | |||
| + | |||
| + | The tag is added to the < | ||
| + | |||
| + | There are the following variant values of the tag: | ||
| + | * unsafe-url - transmits the referrer as is, i.e. completely the URL as everyone is used to | ||
| + | * origin - only domain | ||
| + | * none-when-downgrade - empty referrer if switching to http, and referrer as usual if switching to https | ||
| + | * none - nothing at all | ||
| + | |||
| + | Of these we're only interested in origin and unsafe-url. Technically for trading origin is enough. However, considering that the script often uses redirect to niche by trader referrer, it's better to use unsafe-url. | ||
| + | |||
| + | It's worth noting that this is not a feature of some script, but a feature of modern browsers. | ||
| + | |||
| + | |||
| + | ===== Wrong skimming, wrong redirect, out does not work ===== | ||
| + | |||
| + | 99% of out problems are solved by viewing debug headers of out.php | ||
| + | |||
| + | - Settings - enable debug Add out.php debug comments = yes | ||
| + | - wait a minute for the config to update | ||
| + | - click on any link and see the headers (how to see headers and what it is is described on this page above) | ||
| + | |||
| + | Usually by the headers it's immediately clear what and why, if something is not clear - support on the forum will help figure it out. | ||
| + | |||
| + | |||
| + | ===== How to change country ===== | ||
| + | |||
| + | To test clicks from a certain country you need to change the country for the server. That is, if for example you're in country 1, but need to emulate a click from country 2, you don't need to buy a VPN of country 2, it's enough to specify in common.php something like: | ||
| + | |||
| + | < | ||
| + | |||
| + | if ($_SERVER[' | ||
| + | $_SERVER[' | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | where 1.1.1.1 - replace with your real IP, and DE - replace with the country code you need. | ||
| + | |||
| + | ===== Global Admin does not work ===== | ||
| + | |||
| + | If GA cannot download statistics from another domain, then usually it's a problem on that domain. For example, the domain is on one IP, but DNS points to another, or the admin closed the Smart directory from Google, and as a company closed it from everything. | ||
| + | |||
| + | Check: in the shell on the server where GA is, do wget http:// | ||
| + | |||
| + | and see what the response is. Should answer something like HTTP/1.1 501 Password Error, if not - you need to see the admin where the request actually goes. | ||
| + | |||
| + | ===== Imagemagick lib path error ===== | ||
| + | |||
| + | The script checks the correctness of the path of the main libs, including imagemagick. The check happens as | ||
| + | |||
| + | < | ||
| + | exec("/ | ||
| + | </ | ||
| + | |||
| + | if $error is not 0 (i.e. some error happened, a warning is output. If the admin thinks the path is correct then they can make a PHP file | ||
| + | |||
| + | < | ||
| + | <?php | ||
| + | exec("/ | ||
| + | echo $error; | ||
| + | </ | ||
| + | |||
| + | and check if the error is output. | ||
| + | |||
| + | ===== Cloudflare ===== | ||
| + | |||
| + | In general most proxies http are determined by a header like X-Forwarded-For | ||
| + | (in PHP it's denoted as HTTP_FORWARDED_FOR). When connecting Cloudflare the request itself doesn' | ||
| + | |||
| + | - the real IP that should be in REMOTE_ADDR - this is not the user's IP, but Cloudflare' | ||
| + | - Cloudflare adds the X-Forwarded-For header and all hits become proxies | ||
| + | |||
| + | What to do: | ||
| + | |||
| + | - read their documentation on headers https:// | ||
| + | - read how to restore the real IP https:// | ||
| + | |||
| + | |||
| + | You can also try without mods config modification, | ||
| + | |||
| + | < | ||
| + | if ($http_x_forwarded_for ~ " | ||
| + | set $xreal $2; | ||
| + | } | ||
| + | fastcgi_param HTTP_X_FORWARDED_FOR $xreal if_not_empty; | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== PHP version mismatch ===== | ||
| + | |||
| + | The script is managed by IonCube Optimizer, which requires its own files for different PHP versions. When you run the script installation in the shell, it determines the PHP version it was run with and downloads the files for the needed version | ||
| + | |||
| + | But sometimes there are several PHP versions on the server, one of them is the default. For example if you just write in the shell | ||
| + | |||
| + | < | ||
| + | |||
| + | user@server: | ||
| + | PHP 7.0.33-0ubuntu0.16.04.16+esm4 (cli) ( NTS ) | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | you can see that the default version is 7.0.33, while for the web a different version may be enabled. | ||
| + | |||
| + | Open scj/ | ||
| + | |||
| + | It turns out that files were downloaded for 7.0, but we run with 7.4, in this case IonCube won't work. | ||
| + | |||
| + | You need to ask the admin to unify the versions. | ||
| + | |||
| + | |||
| + | ===== Full description copy - Warning | ||
| + | |||
| + | By default the slave has the same descriptions as the master. Actually it uses the master' | ||
| + | |||
| + | |||
| + | Sometimes people disconnect descriptions, | ||
| + | |||
| + | What's the downside: | ||
| + | |||
| + | - for the slave a table is created with the same descriptions, | ||
| + | - mysql caches both the master table and the slave table, although in fact it's the same data - takes space in memory | ||
| + | |||
| + | Therefore if you don't change the descriptions on the slave, it's better not to disconnect and save server resources. | ||
| + | |||
| + | |||
| + | ===== Server setup error, apache\nginx is running with user permissions - Warning | ||
| + | |||
| + | |||
| + | In all systems there' | ||
| + | |||
| + | There' | ||
| + | |||
| + | Sometimes, for some files, permission must be given to another user to write, for example, the user gives permission to write to one specific file (conditionally log.txt) - to other users (for example apache), then 666 permissions are set on this specific file. | ||
| + | |||
| + | |||
| + | However, sometimes the server is set up wrong, and apache can write to any file of any user. Thus, if there' | ||
| + | |||
| + | ===== You are behind proxy - Warning | ||
| + | |||
| + | For the script it's important to correctly determine if a user is behind a proxy, since the easiest way to hack the script - is to make clicks from different IPs (through proxy) | ||
| + | |||
| + | Proxies are determined by the presence of headers in the request (HTTP_X_FORWARDED_FOR, | ||
| + | |||
| + | But often when setting up nginx + apache the transfer of headers is not set up. It turns out that a request comes with IP 22.22.22.22 to nginx, it should pass this request to apache and " | ||
| + | |||
| + | To prevent this in apache there are mods that automatically process such a situation (mod_remoteip, | ||
| + | |||
| + | ===== Grabber - Can not download ===== | ||
| + | |||
| + | If the grabber (trader thumbnails top, galleries etc i.e. any content that needs to be downloaded) can't download (can nod download, can not connect and so on) then | ||
| + | |||
| + | * downloads not by SmartCJ, but by the server (curl lib specifically) | ||
| + | * to check you can on the server in the shell do | ||
| + | |||
| + | wget http:// | ||
| + | or | ||
| + | curl http:// | ||
| + | |||
| + | * and check what the server answers (99% of cases - you need to write this error to the admin) | ||
| + | |||
| + | What can cause it: | ||
| + | |||
| + | * incorrectly configured DNS: content is on IP 1.1.1.1 but on your server DNS determines it as 2.2.2.2 | ||
| + | * IP of the server from which you're trying to download - is banned on the host from which you need to download | ||
| + | |||
