Troubleshooting

Click on one of the questions below to see the troubleshooting advice. If your question is not answered here please use the contact form.

Q. I need to move my rotator script to a new hosting provider, without losing existing data.

First, you should export a copy of your existing data. To do that:

1. login to your CPanel on your old hosting account
2. go to the phpMyAdmin tool.
3. select the rotator database
4. check all the tables in the rotator database and select Export
5. Export all the tables and data in them as an .sql file (i.e. call it existing_rotator.sql)

Then, on your new host perform an install by following the /doc/install.html instructions in the original .zip package, with the following exception: instead of using the “url_rotator.sql” file in the .zip to create an empty database you should instead use the existing_rotator.sql file that you exported from your existing data. This will create the database tables and insert all your existing portals and destinations.

Q. Error is: An error has occurred: DB Error: unknown error

Your server may have been reset unexpectedly, and you may need to perform a repair on your MySQL database.

You can easily do this yourself by going into your hosting CPanel -> phpMyAdmin. Select the script’s database and it will list the tables in the database. Tick the checkbox next to each of the tables, and you should see a drop-down box saying “With Selected”. Select “Repair table”.

See the screen shot for an example of how to do this.

support-repair-database

Your hosting provider should be able to do this if you contact their support. But it’s helpful to know how to do a MySQL repair yourself.

If you see this “DB: Error: unknown error” error again in the future, in any of your PHP scripts, you can perform a database repair yourself.

 

Save

 

Save

Q. Error is: dbconnection.class.php:14 DB Error: connect failed

 

That error means that the script can not connect to your MySQL database.

Either the MySQL server is down, or the database somehow got deleted, or the config.inc.php settings are somehow no longer valid.

99.9% of the time it is because you have incorrect values in your config.inc.php database login settings.

Make sure that the /include/config.inc.php file contains the correct database settings, including the ‘hostspec’ field, (phpMyAdmin should tell you the server & database values at the top of its pages).

Try using phpMyAdmin to view the database, to make sure it still exists and the server is running. On the “Structure” tab it should list 6 tables, along with the number of records they each have. If any of the tables say “In Use” then it probably needs to be repaired. You can try doing a repair on the tables via phpMyAdmin (tick their checkboxes then select “repair” from the drop-down field).

You can also try asking your web host to check if the database server is up.

 

Q. Error is: Site error: the file /home/username/public_html/url/index.php requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.

This is because the server uses PHP 5.2.5 or higher, and the Ioncube loader must be installed in the php.ini file in this case. Your hosting provider should be able to do this if you contact their support, but it may also be possible for you to use a custom php.ini file to install the Loader yourself.  You should check your web hosting technical support area for information on how to install Ioncube loaders.

Q. Error is: Warning: session_start() function.session-start: open(/tmp/sess_xxx, O_RDWR) failed: Permission denied (13) in /home/username/public_html/url/include/common.inc.php on line 0

These errors indicate a problem with your PHP configuration or filesystem permissions and are not specifically related to the rotator script. You would encounter the same problems on your server with any script that uses PHP sessions. The problem is usually that the server’s PHP session.save_path setting is incorrect.

Try these steps:
1. Create a directory called tmp and give it all permissions 777.
2. Then add something like this to your .htaccess file (adjust the path to tmp as needed):

		php_value session.save_path "/home/yourusername/tmp"

 

Q. Error is: file /httpdocs/url/index.php is corrupted.

This error is probably due to an incomplete file being uploaded when you transferred the script to your server.  Try deleting the corrupted file, and reuploading.  Also, use binary transfer mode in your FTP client when transferring the files.

If the problem remains after reuploading, then the error is probably due to incompatibility between the encoded PHP files and the version of the Ioncube loaders on the server trying to decode them. Basically, the old loaders being used can’t read the new format of the encoded script so it thinks the files are corrupt. The script makes use of recent Ioncube features (such as license files, and ASCII upload compatibility) and so the latest version of the loaders must be used.

A suitable loader for the most common server operating systems is included in the script packages /ioncube/ directory. Provided that you have uploaded this directory and your server supports run-time loading then the script should usually be able to use the correct Ioncube loader.

However, the “file xxx.php is corrupted” message suggests that the correct loader is not being used, and instead an old version of the Ioncube loader is trying to decode the PHP files. This happens when your web host has an old version of the loader already installed server-wide via php.ini, and unfortunately, you cannot override this with runtime loading.

Please contact your web server administrator and let them now that they need to upgrade their Ioncube loaders. They can be freely downloaded here:http://www.ioncube.com/loaders.php. They should have no problem seeing as they’re already using the loader, and the loaders are backward compatible so nobody else on the server will be inconvenienced by the upgrade.

 

Q. I get a 404 Error because my menu links are broken i.e. http://mydomain.com/http://mydomain.com/url/destination_manage.php?cmd=search_own Instead of: http://mydomain.com/url/destination_manage.php?cmd=search_own

 

Make sure that in the /url/include/config.inc.php settings file you have:

$GLOBALS[‘config_settings’][‘short_base_url’] = “/url/”;

Q. Error is: 403 Forbidden / You don't have permission to access /url/ on this server.

This is an uncommon error and can be hard to diagnose. The first thing to do is rename (or delete) the /url/.htaccess file, then visit the script again to see if the error remains. If the error has disappeared then the likely cause is the mod_rewrite rules in the .htaccess file. Restore the /url/.htaccess file and insert:

    Options +FollowSymLinks

into the first line in the file. Then visit the script again, if the error remains please contact us for technical support.

Q. I have installed the script properly, I can set Portals and Destinations without a problem. But when it come to visiting the portals the destinations are not being loaded. Visiting a portal like http://www.mysite.com/url/rotator/admin_portal gives me a 404 error page as if nothing is there at all, or it displays some PHP code.

Please double-check that you have uploaded the /url/.htaccess file included in the .zip package. The rotator script uses mod_rewrite rules defined in .htaccess to transparently rewrite URLs.

Tips & Tricks

What is /url/redir.php?

What It Is

The redir.php file acts as a tunnel between the portal and the destination like so:

traffic source -> portal -> redir.php -> final destination

This is so that the administrators of “final destination” can’t tell where the traffic originated from, all they will see is that it came from redir.php

They will see the redir.php as the referrer and if they visit redir.php directly it will show them a blank page. The redir.php can be renamed to whatever you want, and you can edit it to disguise it by putting in your own html content instead of showing a blank page.

It is not 100% bullet proof. Some browsers may still pass on the referrer string. The cloaker uses a double meta-refresh. It is as solid as I was able to make it, but I can’t guarantee it. The redir.php file is unencrypted so you could modify it if needed. It is disabled by default because it can break the browser’s back button (they have to rapidly click Back button twice instead of once).

You do not link to the redir.php yourself. You do not send any traffic to redir.php directly, just send your traffic to the portal url.

Enabling/Disabling It

The cloaking can be turned on/off per portal through the interface’s “Edit Portal” page. i.e. Go to “Manage Portals” page -> find the portal you want -> click “Edit” button, set “Referrer Cloaking” to Enabled or Disabled.

Or leave the setting as “Use Default” and enable/disable the setting for all portals via the config.inc.php file.

The Referrer Cloaking setting on the Manage Portals Edit screen(Default, Enabled or Disabled) will override whatever is in the config.inc.php file.

To test if it works just visit one of your cloaked portals and look at the address bar in your browser. You should see it pass through redir.php before reaching the final destination.

Advanced Use: Renaming redir.php

The redir.php can be renamed and copied to any domain that you own. So, you can store it on a totally separate server, with no reference to your rotator site. It is a stand-alone file, so if you copy it to your other servers, you don’t need to copy the rest of the script.

If you have not renamed or moved the redir.php file then on your “Add Portal” and “Edit Portal” pages you can leave the “Referrer Cloaking URL” field blank.

If you do rename it, you need to also edit the /include/config.inc.php file to update the referrer_cloaking_url setting. For example, if you have copied and renamed redir.php to yourwebsite.com/home.php then in your config file:

$GLOBALS[‘config_settings’][‘referrer_cloaking_url’] = “http://www.yourwebsite.com/home.php”;

AND/OR you can just paste “http://www.yourwebsite.com/home.php” into the Referrer Cloaking URL field on the appropriate Add/Edit Portal forms. Doing it via the form will overide whatever is in the config.inc.php on a per-portal basis.

Advanced Use: Inserting “landing page” content

You can optionally edit the redir.php file to insert some dummy content. i.e. Go to the very bottom of the redir.php (after the closing ?> tag) and paste in whatever HTML content you want. This is unnecessary. You could do this so that if the administrators of “final destination” did some “investigating” by visiting the redir.php directly, they would see the dummy content, and believe its just a normal webpage instead of blank page.

Recommended Usage

What I recommend is that you leave the config.inc.php “cloak referrer” setting to false (means off). And then for on a portal-by-portal basis enable referrer-cloaking for them on their Manage Portal screen (set it to Enabled). This way you can pick & choose which portals to cloak instead of doing all or none by the config.inc.php

Next, I recommend you copy and rename the redir.php file to another of your domains, and put the new url to it in your config.inc.php referrer url setting.

i.e. If you rename redir.php to landingpage.php and upload it to http://myothersite.com/landingpage.php then you could use “http://myothersite.com/landingpage.php” as the cloaking url when you create a portal.

You can also put some HTML text at the very bottom of the redir.php so if anyone visits that page they will see the text you put there (default is a blank page).

Alternatives

An alternative method for cloaking is to modify your destinations so that they use a 3rd party anonymizer/cloaker. For example a service like “http://anonym.to/”. i.e. instead of using a destination like “http://www.mydestination.com” you could use “http://anonym.to/?http://www.mydestination.com”. This will replace your referrer with “anonym.to”.

I want to use a tracking snippet (ie Google Analytics) to track my hits.

The codefu.net rotator script allows you to add any javascript tracking snippet through a setting in the config file. The setting will affect all portals, in other words, if you add the snippet to the config file, then all portals will be tracked.

 

Edit the /url/include/config.inc.php file in a text editor, and look for the following section:

$GLOBALS['config_settings']['analytics_code'] = <<< END
PASTE YOUR SNIPPET HERE
END;

Simply paste your javascript snippet in the area indicated in red.

If you want to use Google Analytics tracking, I recommend that you use the following snippet, and modify it to insert your own tracking ID:

$GLOBALS['config_settings']['analytics_code'] = <<< END
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._trackPageview();
} catch(err) {}
</script>
END;

Simply replace the UA-XXXXXXXX-X with your actual Google Analytics tracking ID.

I need my main site address (www.yoursite.com) to automatically send me to one of the destinations sites.

Before you proceed you should create a rotator portal that you will use to rotate your http://www.yoursite.com/ traffic. For this example let’s say you have called that portal ‘main’, and it’s auto-generated link is http://www.yoursite.com/url/rotator/admin_main.

There are 4 different methods to choose from: mod_rewrite, meta-refresh, or frames.

Method 1: Use a .htaccess file + mod_rewrite

Pros: Gives the most efficient (fastest) performance.
Cons: Requires your server to have mod_rewrite enabled. This is no big deal, your server is highly likely support it.

Create a text file called .htaccess (NOTE: it starts with a dot and has no other file extension) and paste & edit the following lines into it, substituting your own portal url on the bottom line:

# top-level root / redirection to a rotator portal
RewriteEngine On
RewriteBase /
RewriteRule ^/?$ http://www.yoursite.com/url/rotator/admin_main [L,R,QSA]

Then upload that file to the top directory (the document root, usually called /www/ or /htdocs/ or /public_html/) of your website. Make sure you DO NOT OVERWRITE the /www/url/.htaccess in the rotator script’s directory as it is a completely different file but shares the same name.

Method 2: Use a .htaccess file + mod_rewrite

This is identical to method 1 above – except that this method will not rotate if you have a query string. For example:

Method 1 will rotate traffic sent to either www.yoursite.com or www.yoursite.com?querystring=whatever

Method 2 will only rotate traffic sent to www.yoursite.com, any traffic sent to www.yoursite.com?querystring=whatever will not be rotated. This method must be used if you want your destinations to redirect to www.yoursite.com?querystring=whatever (method 1 would result in an infinite loop).

To use this method, follow the same instructions as method 1, but use this as the .htaccess content:

# top-level root / redirection to a rotator portal
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/?$ http://www.yoursite.com/url/rotator/admin_main [L,R,QSA]

Method 3: Use an index.html file with meta-refresh

Pros: Works with any server. Will display your destination URL in the web browser location bar (i.e. it doesn’t cloak the destination).

Create a text file called index.html then copy and paste the following code into it, substituting your own portal URL:

<html>
<head>
<meta http-equiv="refresh" content="0;url=http://www.yoursite.com/url/rotator/admin_main" />
</head>
</html>

Save the file as index.html and upload it to your main document root of your website (usually the /htdocs/ or /public_html/ or /www/ directory).

Method 4: Use an index.html file with frames

Pros: Works with any server. Will display your site’s main address in the web browser location bar while displaying your destination’s content (i.e. it cloaks the destination).

Con: Some sites are now using anti-framing technology to block other sites from framing them.

Create a text file called index.html then copy and paste the following code into it, substituting your own portal URL:

<html>
<frameset>
<frame src="http://www.yoursite.com/url/rotator/admin_main" />
</frameset>
</html>

Save the file as index.html and upload it to your main document root of your website (usually the /htdocs/ or /public_html/ or /www/ directory).