0
votes

I need your help!! When I load the migration library in codeigniter return a Error 500 and a blank page but if I don't load the library my app works

var_dump("foo1"); //print this line
$this->load->library('migration');
var_dump("foo2"); //not print this line
$this->migration->version(1);

I have the var_dumps because I wanted know where are the error, not print "foo2" so I supposed that error is in $this->load->library('migration');

The library is in /system/libraries/Migration.php

migrations are enabled in /application/config/migration.php $config['migration_enabled'] = TRUE; the version is $config['migration_version'] = 1; and the path is default $config['migration_path'] = APPPATH . 'migrations/';

I enabled the error logging and shows no errors and also I enabled all error reporting in /idex.php (error_reporting(E_ALL);) and neither show anything

Please help me!

PD: Sorry if my english is not good.

That is controller class

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {
public function index(){
  $this->load->library('migration');
  $this->migration->version(1);

  $profile='';
  $auth = false;
  $userdata = array();

  if ($this->session->userdata('logged_in') == TRUE ) {
    $auth = true;

    $user_data = array(
      'username'=> $this->session->userdata('username'), 
      'correo'=> $this->session->userdata('correo'),
      'mensaje' => $this->session->userdata('mensaje'),
      'profile' => $this->session->userdata('profile'),
      'profile_id' => $this->session->userdata('profile_id'),
      'result' => $this->session->userdata('result'),
      'rut' => $this->session->userdata('rut'),
      'logged_in' => $this->session->userdata('logged_in')
    );

    $userdata = $user_data;

    $profile = $this->session->userdata('profile');
  }

  $data = array('auth' => $auth, 'profile' => $profile, 'userdata'=> $userdata);
  $this->load->view('home', $data);
}
}
?>
1
Could you also post the controller code where you load the migration? - Iamzozo
Tested your code and it's working on localhost with root user. I would test as @Eborio write below, also check that you have create table permission with your database user. - Iamzozo
I'm root user, I guess the error is because I use Oracle and the queries from library are from MySql. - Felipe Pincheira

1 Answers

0
votes

Greetings how are you? There you are loading the library right way. But I think you have a mistake as to send a migration run. You followed this step documentation http://www.codeigniter.com/user_guide/libraries/migration.html#create-a-migration That is, the migration file created with the actions to follow?