Welcome Guest, Not a member yet? Register   Sign In
ReflectionException Class Home does not exist Codeigniter 4?
#1

I had installed the fresh Codeigniter4, and configured the basic steps

**Step 1**

    app > app.php > public $baseURL = 'http://121.52.xxx.xxx/faculty_portal/';
    removed index.php from $indexPage='';
    public $uriProtocol = 'PATH_INFO';


**Step 2**

.env file renamed and set the development mode

    CI_ENVIRONMENT = development

**Step 3**

from public folder > moved index.php and .htaccess file to main folder

    .htaccess file has default configuration

whereas the index.php file

    $pathsConfig = FCPATH . 'app/Config/Paths.php';
    require realpath($pathsConfig) ?: $pathsConfig;
    $paths = new Config\Paths();
    $bootstrap = rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';

Error Images are attached here.

https://imgur.com/DEqn974
https://imgur.com/qW0GWUl

I am trying to install it in **subfolder that is faculty_portal**.
Respected community please guide me where I am doing wrong. You guidance/help will be  highly appreciated.


  [1]: https://i.stack.imgur.com/JnUn4.png
  [2]: https://i.stack.imgur.com/iT1wk.png
Reply
#2

(This post was last modified: 08-11-2022, 08:08 AM by captain-sensible. Edit Reason: added )

for local host

public $baseURL = 'http://127.0.0.6/';

I dont mention sub directory in the above. At my webserver root there is a directory called ads.com

I set things up using virtual host:

Code:
<VirtualHost 127.0.0.6:80>
    ServerAdmin [email protected]
    DocumentRoot "/srv/http/ads.com/public"
    ServerName ads.com

127.0.0.6 is set up in /etc/hosts

you can see the DocumentRoot is path of web app to public


On live my approach is as a subdomain , structure very similar to localhost set up.

public $baseURL = 'https://mydomain.com/';
//so still i dont mention public or any other folder, i do that via setting document route cPanel

To get system pointing to public of sub domain i use cPanel and edit document root for subdomain so its subdomainName/public



i'm sure others will give you there approach
CMS CI4     I use Arch Linux by the way 

Reply
#3

(This post was last modified: 08-11-2022, 12:47 PM by NomanJaved.)

(08-11-2022, 08:07 AM)captain-sensible Wrote: for local host

public $baseURL = 'http://127.0.0.6/';

I dont mention sub directory  in the above. At my  webserver root there is a directory called ads.com

I set things up using virtual host:

Code:
<VirtualHost 127.0.0.6:80>
    ServerAdmin [email protected]
    DocumentRoot "/srv/http/ads.com/public"
    ServerName ads.com

127.0.0.6  is set up in /etc/hosts 

you can see the DocumentRoot is  path of web app to public


On live  my approach is as a subdomain , structure very similar to  localhost set up.

public $baseURL = 'https://mydomain.com/';
//so still i dont mention public or any other folder, i do that via setting document route cPanel

To get system pointing to public of sub domain i use cPanel and edit  document root for subdomain so its    subdomainName/public



i'm sure others will give you there approach




--------------------------------------------------------------------------
--------------------------------------------------------------------------

I am using VPS with nginx and it's configuration is

server {
        listen 80;
        server_name localhost; // IP address (151.xxx.xxx.xxx)

        root /var/www/html;

        index index.html index.htm index.php;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
        include snippets/fastcgi-php.conf;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }
       
}
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Reply
#4

Still unresolved. anyone can help
Reply




Theme © iAndrew 2016 - Forum software by © MyBB