Codeigniter Form_Validation issue - php

I have issue with From_Validation in Codeigniter.
Everything work fine in localhost, but when I upload the script in the server (online) I get error.
Severity: Notice
Message: Undefined offset: 0
Filename: libraries/Form_validation.php
Line Number: 226
Line: 238 Function: set_rules
Line: 315 Function: require_once
could you please help me with this?
Thank you

I think you need to Rename First letter of your Filename and Controller to Uppercase. because codeigniter controller name work are case sensitive on server.

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.

Issue: Class 'CI_Config' not found in codeigniter

I am trying to run a codeIgniter project downloaded from 1and1.co.uk ....
But when I am browsing it showing this message:
An uncaught Exception was encountered
Type: Error
Message: Class 'CI_Config' not found
Filename: C:\xampp\htdocs\projectname\system\core\Common.php
Line Number: 196
Backtrace:
File: C:\xampp\htdocs\projectname\index.php
Line: 315
Function: require_once
I dont know why?
The class is ok in system/core/config.
Its version in system/core/codeigniter is 3.1.8.
can anyone tell me the reason pls?
Atleast some clue!
never ever faced anything like this before !
You have duplicate config file also in application/core folder which was causing this issue, there should be only one config in application/config folder.

How to load ion auth model in codeigniter HMVC

I am using the ion auth library for the CodeIgniter HMVC, I have copied all files from ion auth library to main CodeIgniter files but the controller, model, and views files copy to module directory Now it's showing me this error.
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$ion_auth_model
Filename: libraries/Ion_auth.php
Line Number: 122
Backtrace:
File: /opt/lampp/htdocs/CI_Hmvc/application/libraries/Ion_auth.php
Line: 122 Function: _error_handler
File: /opt/lampp/htdocs/CI_Hmvc/application/libraries/Ion_auth.php
Line: 70 Function: __get
File: /opt/lampp/htdocs/CI_Hmvc/application/third_party/MX/Loader.php
Line: 173 Function: _ci_load_library
File: /opt/lampp/htdocs/CI_Hmvc/application/third_party/MX/Loader.php
Line: 192 Function: library
File: /opt/lampp/htdocs/CI_Hmvc/application/third_party/MX/Loader.php
Line: 153 Function: libraries
File:
/opt/lampp/htdocs/CI_Hmvc/application/modules/home/controllers/Auth.php
Line: 9 Function: library
File: /opt/lampp/htdocs/CI_Hmvc/index.php Line: 315 Function:
require_once
could anybody tell me how to load the model, when I work as modules?
I believe the problem is that the library is not finding the model. Check inside ion auth library construct. Look for the line where it says
$this->load->model('ion_auth_model').
It should be line 122 since that's where the error is ocurring. In here you need to prefix the module name - where you have the ion_auth_model - to the model path so the loader class knows where to find it.
In your case if the module's name is directory, then 'directory/ion_auth_model'.
Check this solution https://stackoverflow.com/a/7003180/5785088, point 10, last item. Hope it helps.

CodeIgniter CI Session Error

Am using CodeIgniter for my application, my application working fine, but after sometime, when I reload any page than am getting ci_session error.
Please any one help me to solve this issue...
A PHP Error was encountered
Severity: Warning
Message: unlink(/tmp/ci_session074b4d178c387273e3eee244a10cdbafce7e337e
[function.unlink]: Operation not permitted
Filename: drivers/Session_files_driver.php
Line Number: 371
Backtrace:
File: /home/applic/public_html/workshop/application/controllers/Reports.php
Line: 7
Function: __construct
File: /home/applic/public_html/workshop/index.php
Line: 292
Function: require_once
In the config.php file you MUST set sess_save_path to a valid path. It was initially set to NULL.
$config['sess_save_path'] = BASEPATH . 'cache/';
if you create a folder 'sessions' and put it in your application folder you can use this:
$config['sess_save_path'] = APPPATH.'/sessions'

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?

Categories