douzhong5902 2015-11-06 01:49
浏览 40
已采纳

上传到主机后Codeigniter rest server 500错误

My codeigniter 3 application uses rest server. My application is working locally and when i uploaded application works except post end points of rest server routes gives 500 error but nothing on error log file.

Server uses

PHP 5.3.28 (cli) (built: Dec 17 2013 00:28:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

and server is Linux 3.2.28-45.63.amzn1.x86_64 x86_64

I use 5.3 in my ampps setup. In local setup everything works fine.

routes files has custom routes

$route['api/subscription/notify'] = 'api/subscription/notify'; 
$route['api/ussd/receiver'] = 'api/ussd/receiver';

Add Subscription.php and USSD resides in api folder inside controllers folder.

I use .htaccess file to remove index.php from URLS.

it's

RewriteEngine on

RewriteCond $1 !^(index\.php|assets|imapp|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]

And

$config['index_page'] = '';

Is set like this in config.php

  • 写回答

1条回答 默认 最新

  • duangelin7513 2015-11-06 19:20
    关注

    I finally found the error. Rest Server is needed PHP5.4 or higher since it uses ne array [] format. So help of some other repo in Github I was able to make it compatible with PHP 5.3.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀