CodeIgniter Forums
Problem when trying to deploy - 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: Problem when trying to deploy (/showthread.php?tid=75816)



Problem when trying to deploy - wilomoura - 03-19-2020

Hi guys, I'm facing a problem when deploying the system on a real server
My Server
Ubuntu 16.04
PHP 7.2
Nginx
www path: /var/www/html


I attached the photo of the error that presents me when entering the system url.

   

If anyone has any idea where I can start looking for the reason for this problem.


RE: Problem when trying to deploy - captain-sensible - 03-19-2020

probably the top line ;your using some sort of layout rather than

say

Code:
{
$data['title'] = ucfirst($page);    
                                            
                                        echo view('header',$data);
                                            echo view($page);
                                            echo view('footer');    
                                            
                                        }


it might be a Nginx(which i no nothing about) thing but on apache on my local its /var/www/htdocs

I see you have a html in path ?


i got the basics working at : https://www.benxmidia.com

it wasn't much different to my local dev on apache , where i use virtual host. the only thing was to set document root to /public.


RE: Problem when trying to deploy - kilishan - 03-19-2020

Layouts work fine - but your error says it can't find your view file - and it has slashes going forward and backward. I'm guessing you develop on a Windows machine and deployed to a Linux box? All slashes should be forward slashes for that.


RE: Problem when trying to deploy - eafarooqi - 03-20-2020

yes its forward and backslash issue. You need to use forward slashes, works on windows and linux.

or you have to use full path with backslash like
app\views\header

this also works but doesn't looks like a good idea. Smile