上传到主机后 Codeigniter 休息服务器 500 错误
Codeigniter rest server 500 error after uploading to hosting
我的 codeigniter 3 应用程序使用 rest 服务器。我的应用程序在本地工作,当我上传应用程序时,除了 post 其余服务器路由的端点会出现 500 错误,但错误日志文件中没有任何内容。
服务器使用
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
并且服务器是 Linux 3.2.28-45.63.amzn1.x86_64 x86_64
我在 ampps 设置中使用 5.3。在本地设置中一切正常。
路由文件有自定义路由
$route['api/subscription/notify'] = 'api/subscription/notify';
$route['api/ussd/receiver'] = 'api/ussd/receiver';
添加 Subscription.php 并且 USSD 位于控制器文件夹内的 api 文件夹中。
我使用 .htaccess
文件从 URLS 中删除 index.php
。
是
RewriteEngine on
RewriteCond !^(index\.php|assets|imapp|robots\.txt)
RewriteRule ^(.*)$ index.php?/ [L]
和
$config['index_page'] = '';
在config.php
中是这样设置的
我终于找到错误了。需要 PHP5.4 或更高版本的 Rest Server,因为它使用 ne array [] 格式。所以在 Github 中的其他一些回购的帮助下,我能够使其与 PHP 5.3.
兼容
我的 codeigniter 3 应用程序使用 rest 服务器。我的应用程序在本地工作,当我上传应用程序时,除了 post 其余服务器路由的端点会出现 500 错误,但错误日志文件中没有任何内容。
服务器使用
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
并且服务器是 Linux 3.2.28-45.63.amzn1.x86_64 x86_64
我在 ampps 设置中使用 5.3。在本地设置中一切正常。
路由文件有自定义路由
$route['api/subscription/notify'] = 'api/subscription/notify';
$route['api/ussd/receiver'] = 'api/ussd/receiver';
添加 Subscription.php 并且 USSD 位于控制器文件夹内的 api 文件夹中。
我使用 .htaccess
文件从 URLS 中删除 index.php
。
是
RewriteEngine on
RewriteCond !^(index\.php|assets|imapp|robots\.txt)
RewriteRule ^(.*)$ index.php?/ [L]
和
$config['index_page'] = '';
在config.php
我终于找到错误了。需要 PHP5.4 或更高版本的 Rest Server,因为它使用 ne array [] 格式。所以在 Github 中的其他一些回购的帮助下,我能够使其与 PHP 5.3.
兼容