【发布时间】:2020-05-16 13:04:46
【问题描述】:
我是 Extjs 的新手。我有一个 test.js.php 页面,其中的一部分是 Ext.data.Store :
this.store2 = new Ext.data.Store({
fields : ["Pid","bid"],
proxy : {
type: 'jsonp',
url: '../d/sample.data.php?task=GetUser',
reader: {
root: 'rows',
totalProperty: 'totalCount'
}
}
});
在 ../d/sample.data.php 页面中,我有这个:
$task = isset($_POST ["task"]);
if($task == "GetUser")
GetUser();
function GetUser() {
$dt = array();
$dt = array_merge($dt, Pdo::runquery("select PID , bid from mytable where PID = ? ", array($_SESSION['PID'])));
echo dataReader::getJsonData($dt, count($dt), $_GET["callback"]);
die();
}
这些代码在站点中运行良好,但在我的 virtualHost 中运行不正常。当我在 localhost 中运行时,在控制台中收到此消息: SyntaxError: expected expression, got ' 它引用了 sample.data.php:1
我在下面尝试 /var/www/myVirtualHostName 中的所有文件:
chmod 777 -R ./*
ps: 我正在使用 ubuntu 20.04 、虚拟主机、php5.6 和 apache2
【问题讨论】: