CodeIgniter Forums
Server migration and the Config/Paths.php file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Server migration and the Config/Paths.php file (/showthread.php?tid=77690)



Server migration and the Config/Paths.php file - berendbotje91 - 10-05-2020

I just migrated my project from 1 server to another and kept having problems with trying to run it. I kept keeping blank pages, and no errors in the log of CodeIgniter. Meanwhile it worked fine on the old server.

So I looked a bit deeper in error logs and found this:
Code:
Got error 'PHP message: PHP Fatal error:  Uncaught Error: Object of class Config\\Paths could not be converted to string

In index I found that the actual line was line 16 and that contains this:
Code:
$pathsPath = FCPATH . '../app/Config/Paths.php';

I found out that new projects have it changed to
Code:
$pathsPath = realpath(FCPATH . '../app/Config/Paths.php');

So I'm just curious... Why did it worked before without realpath()? Both servers run Ubuntu 20.04 with PHP7.4-fpm. (although the older one was upgraded from 18.04)