php脚本适用于shell,但不适用于webserver

时间:2018-05-01 16:24:44

标签: php webserver file-permissions fuseki arc2

如果我在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>

0 个答案:

没有答案
相关问题