CodeIgniter Forums

Full Version: Warning: Invalid Path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
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.
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?
$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.
(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';
(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.
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.
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
I find the answer:

config/config.php

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

With: $config['sess_save_path'] = sys_get_temp_dir();
(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/li...references
Pages: 1 2