CodeIgniter Forums
Empty page with index.php in plain text - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Empty page with index.php in plain text (/showthread.php?tid=78244)



Empty page with index.php in plain text - michelJ-5 - 12-20-2020

Hi @all,

Hope someone can help me sort this issue out.

I'm working in a local vagrant machine (Ubuntu 18.01, PHP 7.2) environment on a SaaS project on CodeIgniter 4.0.3. That all works great and the project is almost ready to be deployed. But I wanted to switch to CodeIgniter 4.0.4 and PHP 7.4 and now I'm running into issues.

I made a new vagrant machine with PHP 7.4, then installed CodeIgniter 4.0.4 on it and this works without any issues. I do get the standard CodeIgniter welcome screen.

I then remove the app and public folders and copy the app and public folders of my project on to the new machine. I then adjust the settings in the app.php file and the .env file.

If I try to start the application I first got a "Whoops! We seem to have hit a snag. Please try again later..." warning. After some searching I found an error logging that indicated the change of the before and after functions in the FilterInterface class (https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_404.html). So adding the $arguments parameters to the functions I used in an authentication class of my own fixed that.

But now, when I try to access the application I get an empty page with only the text index.php in it. The source of the page also has only index.php in it.

Unfortunately there is no error log or anything that could indicate where to look for a solution.

Any suggestions about a cause or how I could debug this issue?


RE: Empty page with index.php in plain text - includebeer - 12-21-2020

Maybe this article can help you diagnose the problem: https://includebeer.com/en/blog/the-checklist-of-things-to-check-when-your-codeigniter-4-web-application-is-not-working#checklist-htaccess

But the first thing I would do is compare the changes between 4.0.3 and 4.0.4 to see if you have anything to fix in your app and public folders. Especially the config folder and the .htaccess file.


RE: Empty page with index.php in plain text - michelJ-5 - 12-22-2020

Thanks for your reply @includebeer,

Great article btw. It did not exactly solve my issue, but it got me in the right direction.

Whilst trying out a few things in the .htaccess file I noticed that only the <IfModule !mod_rewrite.c> part was active. That brought me to the idea that probably the mode_rewrite was not enabled. Enabling the mode_rewrite solved my issue.

Thanks for your help.


RE: Empty page with index.php in plain text - includebeer - 12-22-2020

Glad you solved it!  Cool