Saturday 10 June 2017

php - SEOstats giving error on server

When i used it on localhost it works perfactly fine but when I move the same SEOstats-master directory to my server it give me following error in the errorlog file and the browser page becomes blank.



  PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/abctest/public_html/example.net/SEOstats-master/example/get-alexa-graphs.php on line 15


Can anyone help ??



the code in the get-alexa-graphs.php is




   /**
* SEOstats Example - Get Alexa Traffic Metrics' Graphs
*
* @package SEOstats
* @author Stephan Schmitz
* @copyright Copyright (c) 2010 - present Stephan Schmitz
* @license http://eyecatchup.mit-license.org/ MIT License
* @updated 2013/08/17
*/


// Bootstrap the library / register autoloader
require_once (__DIR__ . '\..') . '\SEOstats\bootstrap.php';

use \SEOstats\Services\Alexa as Alexa;

try {
$url = 'http://www.nahklick.de/';

// Create a new SEOstats instance.

$seostats = new \SEOstats\SEOstats;

// Bind the URL to the current SEOstats instance.
if ($seostats->setUrl($url)) {

/**
* Print HTML code for the 'daily traffic trend'-graph.
*/
echo Alexa::getTrafficGraph(1);


/**
* Print HTML code for the 'daily pageviews (percent)'-graph.
*/
echo Alexa::getTrafficGraph(2);

/**
* Print HTML code for the 'daily pageviews per user'-graph.
*/
echo Alexa::getTrafficGraph(3);


/**
* Print HTML code for the 'time on site (in minutes)'-graph.
*/
echo Alexa::getTrafficGraph(4);

/**
* Print HTML code for the 'bounce rate (percent)'-graph.
*/
echo Alexa::getTrafficGraph(5);


/**
* Print HTML code for the 'search visits'-graph, using
* specific graph dimensions of 320*240 px.
*/
echo Alexa::getTrafficGraph(6, false, 320, 240);
}
}
catch (\Exception $e) {
echo 'Caught SEOstatsException: ' . $e->getMessage();
}



and the code at the line 15 is:



 use \SEOstats\Services\Alexa as Alexa; 

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...