Codeigniter: application/config/routes.php file does not appear to contain a valid configuration array

236
September 11, 2018, at 1:50 PM

Today I upgraded my codeigniter project from 2.x to 3.1.9. Everything required for new update done as shown in Codeigniter Upgrade tutorial Upgrading from 2.2.x to 3.0.x . But when I run my project in the browser it is showing error

Your C:\wamp64\www\the_quarry_2.4_upgraded\application\config/routes.php file does not appear to contain a valid configuration array.

My project root folder is :

C:\wamp64\www\the_quarry_2.4_upgraded

Contents of application/config/routes.php are:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'home/index';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

But when I added the following lines of codes below $route array, it is working fine.

$config['default_controller'] = 'home/index';
$config['404_override'] = '';
$config['translate_uri_dashes'] = FALSE;

So what may be caused the error?

Rent Charter Buses Company
READ ALSO
Trying to loop inside array

Trying to loop inside array

I am working on a PHP file

123
Lots of routes declared in Symfony project, but cannot GET any of them

Lots of routes declared in Symfony project, but cannot GET any of them

I'm trying to set up an extant Symfony project on my local machine

248
Setting up SQS message queue on AWS with Laravel

Setting up SQS message queue on AWS with Laravel

We are in the process of moving an existing application from Linode to AWSOn Linode, we used beanstalkd as our message queue and now we wanted to try SQS

226
PDF Generation of D3 charts in PHP [on hold]

PDF Generation of D3 charts in PHP [on hold]

I am working on a back-end report generation functionality in PHPReports which are rendered on the browser also include d3

216