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.

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

报告相同问题?