Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

872
Visualizações
CodeIgniter project not work on Linux-based remote server

I developed a project with CodeIgniter on windows XAMPP which works. But does not work on Linux-based remote server.

I get the error:

Unable to load the requested file: home.php

Controller: home.php:

public function index(){
  $this->load->view('home');
}

.htaccess:

RewriteEngine on
RewriteCond $1 !^(index\\.php|resources|robots\\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

On codeIgniter 3 + versions a couple of checks to do if getting errors below.


  • error 404 page not found
  • Unable to load the requested file

Check first.

  • Make sure your file name has the first letter upper case only
  • Make sure your class name has first letter upper case only
  • This applies for models as well.

Warning: Some times even though lower case may work on some localhost some other operating systems it may cause error when file or class are lower case, it may not be the same for everyone.

Controller

File name: Home.php

<?php

class Home extends CI_Controller {

     public function __construct() {
        parent::__construct();
        $this->load->model('model_example');
     }

     public function index(){
        // $data['results'] = $this->model_example->get_results();
        $this->load->view('home');
     }
}

Folder Structure for View

application

application > views > home.php

Models

File name: Model_example.php

<?php

class Model_example extends CI_Model {

    public function get_results() {
      // Some Code Here.
    }
}

On your config.php

$config['base_url'] = 'http://localhost/your_project_name/';
over 4 years ago · Santiago Trujillo Relatório

0

Rather than uploading the codeigniter site directly you should be able to use something like Putty (http://www.putty.org/) to install a fresh version of Codeigniter through script and then add the files for your site to the installation.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

The script used to install a fresh version of CI will differ based on what Linux platform you're using. wget is used for ubuntu.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda