Showing posts with label Codeigniter open_basedir_restriction in effect. Show all posts
Showing posts with label Codeigniter open_basedir_restriction in effect. Show all posts

Thursday, 28 April 2016

Codeigniter open_basedir_restriction in effect



Error :

Message: mkdir(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/thelazyppl/:/home/thelazyppl:/tmp:/usr/local/lib/php/)

Filename: drivers/Session_files_drivers.php

Details About Error :

CodeIgniter installation is trying to save its session files to somewhere that is unwritable .  I would like to recommend you store sessions in database . You need to do this settings in config.php file Under Application -> Config Folder in Your CodeIgniter Project Default Structure

In My Case I was using CodeIgniter3 Version . You Can Use The Below User Guide Link To Make Configurations Required For Solving this error properly 

User Guide For CodeIgniter 3 :User Guide CodeIgniter3 Open_basedir_restriction in effect

Sure Short Solution For CodeIgniter 3 :- 


  • Navigate to your project folder - Under Application folder in Codeigniter go Under Config Folder
  • Then Open Config.php file Search For below line of code$config['sess_save_path'] = NULL;
  • And Replace this line of code with line of code below -
    $
    config['sess_save_path'] = '/tmp';


The better option would be to use the database driver, for which the details are just below that.
If you were having these issues on CodeIgniter 2, you would need definitely need to enable the database. To do this you would change the $config['sess_use_database'] option to TRUE and then run the SQL shown in the CodeIgniter 2 user guide.