In the controller folder, some classes can be accessed and some classes cannot be accessed. Why?
echo
echo 2020-11-11 15:20:19
0
2
949

The project I took over is a CI framework. After writing several classes, the following phenomenon occurred:

Routing access situation:

Localhost:70/project name/index.php/apicontent /method: Can visit

Localhost:70/project name/index.php/moment/method: Can visit

****://domain name/apicontnt/method: Can visit

****://domain name/moment/method: 404 not found

In the mid-term, the domain name is the online environment.

The routing configuration is as follows:

$route['default_controller'] = 'content/index';

$route['(:any)'] = 'home/index/$1';

What are the possible reasons? Please give me some guidance, thank you very much! ! !

echo
echo

reply all (1)
echo

This issue has been resolved.

The reason is: the online CI version is 2, while the offline CI version is 3. The offline version supports lowercase first letters of file names, while the online version only supports uppercase first letters of file names, so The result is that when a file that runs well offline is uploaded online, the file name cannot be found.

The second inspiration is that it is not sensitive to error messages. The error has been reported as not found, which at least indicates that the method is correct. At this time, you should no longer suspect routing configuration errors, but should focus directly on the direction of not finding the file.

  • reply Thumbs up for you!
    z老师 author 2020-11-11 18:35:34
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!