Troube with migrate an codeigniter system - php

I'm trying to migrate an codeigniter system for my localhost, but i'm receiving this message:
A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 257
Fatal error: Class 'CI_Controller' not found in C:\xampp\htdocs\sistema-emisa\system\core\CodeIgniter.php on line 233
I've download the following pages from the host:
application ~
public_html ~
system
I changed the enters of the BD for the corrects on my localhost but still didnt work. I have to do some setting or download something else?
The server have this estructure:

One quick fix needs to be done.
Go to your system/core/Common.php file.
And search for return $_config[0] =& $config;
and replace this content with either of the following two snippets:
$_config[0] =& $config;
return $_config[0];
OR
return isset($_config[0][$item]) ? $_config[0][$item] : NULL;
Both of the above given pieces of codes will work.

Related

Can't get the default controller of codeigniter to work in IIS

I am trying to host a codeigniter project on IIS Server but I can't get even the default controller to show instead what I receive is this below
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 101
Backtrace:
File: C:\inetpub\wwwroot\app\index.php
Line: 315
Function: require_once
I have web.config file, HTTP mappings, ISAPI, URL rewrite module and FastCGI all set but still the problem persist.
I will be very grateful if you guys can help me, am stranded.

Severity: Core Warning Message: Module 'mysqli' already loaded

I was developing a website via localhost, everything was working well, but I just uploaded the website online, everything else seems to work well except this sticky message below my footer :
`
A PHP Error was encountered
Severity: Core Warning
Message: Module 'mysqli' already loaded
Filename: Unknown
Line Number: 0
Backtrace:
`
Its showing line number 0, I have no idea what this means. If this can be fixed, How? and if so, is the problem from my side or my hosting providers?
Follow these steps:
1) Controller class name should start with capital.
2) Filename name should start with capital.
Because Linux is case sensitive.

Fatal error: Class 'CI' not found after uploading to live server

I have a project built in Codeigniter 3 + HMVC. And Im almost done with it.
In my local copy it is working properly. But when I moved my project on a live server I got this error:
Fatal error: Class 'CI' not found in /var/www/vhosts/kuni.ph/httpdocs/teradasys/application/third_party/MX/Modules.php on line 92
A PHP Error was encountered
Severity: Error
Message: Class 'CI' not found
Filename: MX/Modules.php
Line Number: 92
Backtrace:
And here's the code on line 92
/* find the controller */
list($class) = CI::$APP->router->locate(explode('/', $module));
I dont know what is the error all about.
I also checked the config.php and update the base_url. And I also updated the database config.
Can you help me with this?

CodeIgniter Database Session Error

When I try to execute any controller of my CodeIgniter project i receive this error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered
Severity: Error
Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)
Filename: drivers/Session_files_driver.php
Line Number: 49
Backtrace:
I tried to replace CodeIgniter system files but it didn't work. The problem appears in all projects
Problem solved by restarting Apache.
I attach the url which saved me: http://forum.codeigniter.com/thread-64763.html
In my case i did the following
Restart apache
That's it!
The files in system should not be modified. My files were modified somehow and were throwing error. I resolved my problem as below.
Download fresh codeigniter and extract files
copy system files from fresh codeigniter into your project and overwrite the whole system folder.
This should fix your problem.

Problem with passing data to view in codeigniter code

I have a codeigniter code that is working on local Apache installation. But it does not work on Godaddy Hosting.
I have got other similar views and controllers which are working on Godaddy.
Following is the code. I have pasted only relevant code.
Controller:
function index() {
$this->load->model('Feedmodel');
$data['posts']=$this->Feedmodel->gethomedata();
$this->load->view('home',$data);
}
View:
PHP CODE ONLY
foreach($posts as $post){
echo $post['url'];
}
The error that I am getting is
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: posts
Filename: views/home.php
Line Number: 59
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/home.php
Line Number: 59
The same code is working fine with other controllers and views...
The reason that you are getting an error notice in the GoDaddy environment and not in your local installation is most probably because of different error reporting in the two php installations. Edit your local php.ini and index.php in the root codeigniter dir and verify that error_reporting(E_ALL); exists.
Also are you using the foreach loop to iterate through all the HTTP POST variables? if so try changing it to
foreach($_POST as $post){
echo $post;
}
you could also use codeigniter's input library to do this.
$post_url = $this->input->post('url');

Categories