当我在 localhost 上使用它时,它工作得非常好,但是当我将相同的 SEOstats-master 目录移动到我的服务器时,它在错误日志文件中出现以下错误,并且浏览器页面变为空白。
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
谁能帮忙??
get-alexa-graphs.php 中的代码是
<?php
/**
* SEOstats Example - Get Alexa Traffic Metrics' Graphs
*
* @package SEOstats
* @author Stephan Schmitz <eyecatchup@gmail.com>
* @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();
}
第 15 行的代码是:
use \SEOstats\Services\Alexa as Alexa;