dos8410 2016-03-02 11:34
浏览 85

打开所需的Slim / Slim.php失败

Hi I am new in slim framework and using Slim framework in backend and using AngularJS in client, when load data from server this following error show:

Fatal error: require(): Failed opening required 'Slim/slim.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngelgir0/public_html/api/index.php on line 3

Here is my folder structure:

public_html/
    - api
    + Slim
    index.php
    .htaccess

enter image description here

And here is the first few lines in index.php:

<?php
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
$app = new Slim();

// endpoints related with FeedbackFormsResource
$app->get('/feedbacks', 'getFeedbackForms');
$app->get('/feedbacks/:id', 'getFeedbackFormsById');
$app->get('/feedbacks/search/:query', 'findFeedbackForm');
$app->post('/feedbacks/', 'addFeedbackForm');
$app->put('/feedbacks/:id', 'updateFeedbackForm');
$app->delete('/feedbacks/:id', 'deleteFeedbackForm');

And this is what I have for .htaccess file:

RewriteEngine On
RewriteBase /api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
  • 写回答

2条回答 默认 最新

  • duanpang2751 2016-03-03 14:34
    关注

    Your screenshot says that the error is located in api/index.php.
    If you have require Slim/slim.php inside that index.php that Slim folder must be inside api.

    To fix that do a

    require '../Slim/Slim.php';
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器