CodeIgniter Forums
Warning: Invalid Path - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Warning: Invalid Path (/showthread.php?tid=65331)

Pages: 1 2


Warning: Invalid Path - davy_yg - 05-31-2016

A PHP Error was encountered

Severity: Warning
Message: mkdir(): Invalid path
Filename: drivers/Session_files_driver.php
Line Number: 117

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

An uncaught Exception was encountered
Type: Exception
Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php
Line Number: 119
Backtrace:


File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once

------------------------------------------------

drivers/Session_files_driver.php
line 117:              if ( ! mkdir($save_path, 0700, TRUE))

controllers\cpages.php
line34:      $this->load->library('session');

drivers\Session_files_driver.php
line 119:                       throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created.");


Where to find this error:  File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once  ?

Thanks in advance.


RE: CI Error - arma7x - 05-31-2016

what is your session save_path value. Make sure the folder is WRITABLE. Or you can save session by create new folder inside application folder and use APPPATH.'foldernameyoucreate' as save_path value.


RE: CI Error - davy_yg - 05-31-2016

Perhaps my new folder called storage inside application. And I try to declare save_path:

save_path = APPPATH.'storage';

inside: Session_files_driver.php and I get this error:


Parse error: syntax error, unexpected '=' in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php on line 39
A PHP Error was encountered

Severity: Parsing Error

Message: syntax error, unexpected '='

Filename: drivers/Session_files_driver.php

Line Number: 39

Backtrace:

What I did wrong?


RE: CI Error - arma7x - 05-31-2016

$config['sess_save_path'] = APPPATH.'storage' in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\config\config.php
Don't touch any files in system folder.


RE: CI Error - ciadmin - 05-31-2016

(05-31-2016, 06:02 AM)davy_yg Wrote: Perhaps my new folder called storage inside application.  And I try to declare save_path:

save_path = APPPATH.'storage';

inside: Session_files_driver.php and I get this error:


Parse error: syntax error, unexpected '=' in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php on line 39
A PHP Error was encountered

Severity: Parsing Error

Message: syntax error, unexpected '='

Filename: drivers/Session_files_driver.php

Line Number: 39

Backtrace:

What I did wrong?

Variable names need a dollar sign in front of them in PHP.

save_path = APPPATH.'storage';
should be
$save_path = APPPATH.'storage';


RE: CI Error - ciadmin - 05-31-2016

(05-31-2016, 08:38 AM)arma7x Wrote: $config['sess_save_path'] = APPPATH.'storage' in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\config\config.php
Don't touch any files in system folder.

APPPATH refers to application/, not to the system folder.


RE: Warning: Invalid Path - davy_yg - 06-01-2016

ok. I already have : $config['sess_save_path'] = APPPATH.'storage' in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\config\config.php


I still have the same error that I posted in my first post in this thread.


RE: Warning: Invalid Path - davy_yg - 06-07-2016

Can anyone help fix this: (I still have similar error)


A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 118

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once
An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\system\libraries\Session\drivers\Session_files_driver.php

Line Number: 120

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\application\controllers\cpages.php
Line: 34
Function: library

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\CompanyProfileCI\index.php
Line: 315
Function: require_once


RE: Warning: Invalid Path - davy_yg - 06-07-2016

I find the answer:

config/config.php

Replacing: $config['sess_save_path'] = NULL;

With: $config['sess_save_path'] = sys_get_temp_dir();


RE: Warning: Invalid Path - ciadmin - 06-07-2016

(06-07-2016, 10:31 PM)davy_yg Wrote: I find the answer:  

config/config.php

Replacing:  $config['sess_save_path'] = NULL;

With:  $config['sess_save_path'] = sys_get_temp_dir();

Hmmm - that is clear in the user guide ... http://www.codeigniter.com/user_guide/libraries/sessions.html#session-preferences