CodeIgniter Forums
Random Access Denied - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Random Access Denied (/showthread.php?tid=67544)

Pages: 1 2


Random Access Denied - joaofrassetto - 03-07-2017

Hello, I looked a little bit the forum. I'm new here, so please excuse me if I'm doing something wrong.

I hava a CI application that has a dashboard to manage the pages. Sometimes I get an error 403 and an error 500 in somepages, but refreshing or accessing again this page, the page works correctly. Apparently this occur just in the pages of the dashboard.

Thank you.


RE: Random Access Denied - InsiteFX - 03-08-2017

You need to explain what your problem is an any errors that you are getting.


RE: Random Access Denied - joaofrassetto - 03-08-2017

I'm using google chrome (Version 56.0.2924.87 64-bit), and I go to my application, but sometimes, I can't tell when or which page, gives me an access denied error, and sometimes it works perfectly. If I get an error and then refresh the same page, this page works perfectly.

The imagem (       ) show the error I get just right now.

The imagem (       ) show same page that gives me the error before, just refreshed and working.


RE: Random Access Denied - InsiteFX - 03-08-2017

I am also running Chrome x64 and do not have this problem, can you use the advanced forum editor and show the code for your form?

I am running Windows 10 Pro x64


RE: Random Access Denied - joaofrassetto - 03-08-2017

It's possible something on the server is offline and after my request it's initialized and become online, like a service? Because after the first error on the page, the error takes some hours to occur again. I'm using a free hosting service.

Later I will show the code. I'm at work right now, and the code is in my personal notebook.

Thank you.


RE: Random Access Denied - albertleao - 03-08-2017

Check you php log and see what the 500 error is.


RE: Random Access Denied - joaofrassetto - 03-08-2017

How can I check this PHP log, please?


RE: Random Access Denied - albertleao - 03-08-2017

What environment are running in? Xampp, linux?


RE: Random Access Denied - joaofrassetto - 03-08-2017

I think it's running in a linux instance. Apache version 2.4 and PHP version 5.5.

This is the controller PainelDeControle.php:

Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class PainelDeControle extends CI_Controller {

 public function index()
    {
   $this->load->helper('myhelperacesso');
   if (usuarioLogado()) {
     $this->load->view('templates/header.php');
     $this->load->view('templates/headerPainelDeControle.php');
     $this->load->view('templates/menuHeaderPainelDeControle.php');
     $this->load->view('painelDeControle/index.php');
     $this->load->view('templates/menuFooterPainelDeControle.php');
     $this->load->view('templates/footerPainelDeControle.php');
     $this->load->view('templates/footer.php');
   } else {
     $this->session->set_flashdata("mensagem-fracasso", "Acesso negado. Nenhum usuário logado.");
   
     $this->load->helper("url");
     redirect(base_url("index.php/usuario/entrar"));
   }
    }
}

?>

In the index() function the else statement is executed, because there's no user yet defined.


RE: Random Access Denied - InsiteFX - 03-09-2017

According to the documentation I think you need to upgrade your PHP version.

PHP version 5.6 or newer is recommended.