找不到php restler explorer 404../resources.json
当我尝试运行restler资源管理器时,我总是 404:找不到../resources.json 我走来走去,没有找到解决这个问题的办法。这似乎不是权限问题,也不是PHP版本问题 我的.htaccess看起来像这样找不到php restler explorer 404../resources.json,php,json,.htaccess,explorer,restler,Php,Json,.htaccess,Explorer,Restler,当我尝试运行restler资源管理器时,我总是 404:找不到../resources.json 我走来走去,没有找到解决这个问题的办法。这似乎不是权限问题,也不是PHP版本问题 我的.htaccess看起来像这样 Options -MultiViews DirectoryIndex index.php <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ index.php [QSA,L]
Options -MultiViews
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
选项-多视图
DirectoryIndex.php
重新启动发动机
重写规则^$index.php[QSA,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php[QSA,L]
php_标志显示_错误关闭
如果我在运行时出现php错误,我会注意到一些警告,这些警告可能与问题有关,也可能与问题无关
警告:realpath()希望参数1是有效路径,第161行的/home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php中给出的数组,第161行的/home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php中给出的数组警告:realpath()期望参数1是有效路径,第161行的/home/sonic/Public/html/ucemi/ucemi.com/vendor/Luracast/Restler/AutoLoader.php中给出的数组{“错误”:{“代码”:404,“消息”:“未找到”} 我按照说明将vendor/luracast/explorer/dist目录复制到API的根目录(public/explorer),并在public/explorer中创建index.php,如下所示:
<?php
use Luracast\Restler\Restler;
require_once '../../vendor/restler.php';
$r = new Restler();
$r->addAPIClass('Luracast\\Restler\\Resources'); //this creates resources.json at API Root
//... add more api classes if needed
$r->handle();
您使用的是资源以外的其他API类吗?除资源外,至少应存在一个类。如果是,可以尝试运行composer update。如果无法在服务器上运行composer update,请在本地主机(开发服务器)上运行它,然后将生成的文件上载到server@Luracast,我已在本地主机上运行Composer,然后已上载到服务器。我也有同样的问题。是否可以手动安装Restler资源管理器?
<VirtualHost *:80>
ServerAdmin root
ServerName ucemi.com
DocumentRoot /home/sonic/Public/html/ucemi/ucemi.com/public
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/sonic/Public/html/ucemi/ucemi.com/public>
AllowOverride All
Options FollowSymlinks
Order allow,deny
allow from all
</Directory>
</VirtualHost>