0

如果我在 shell ( $ php test.php) 中执行它,我的 php 脚本可以完美运行。但是,如果我在我的网络浏览器中调用相同的 php 文件,它只会部分工作。

我在 Debian4.9 系统上工作,php 文件在/var/www/html/(将改变它)。我怀疑这是一些权利问题,但我不知道究竟是什么以及如何解决它。如何授予www-data(或谁?)执行 php 模块ARC2并从我的Fuseki 2服务器发出 SPARQL 请求的权限?

我的 MWE:

<html>
    <body>
        <?php
            include_once("semsol/ARC2.php");
            $config = array (
                'remote_store_endpoint' => 'http://localhost:3030/test/query',
            );
            $store  = ARC2::getRemoteStore($config);
            $query  = 'SELECT * WHERE {?s ?p ?o} LIMIT 10';
            $rows   = $store->query($query, 'rows');

            echo "<table>";
            foreach ($rows as $row) {
                print "<tr><td>" .
                $row['s'] . "</td><td>" .
                $row['p'] . "</td><td>" .
                $row['o'] . "</td></tr>" ;
            }
                echo "</table>";
        ?>
    </body>
</html>

在控制台中它解析得很好,在浏览器中它停在<html><body>.

4

0 回答 0