Fatal error: session_start(): - php

When I migrated magento store and run it locally this happens.
Failed to initialize storage module: user (path: C:\wamp\www\magento\var\session) in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 115
This is line 115: session_start();
Help please.

For future reference, core_session table is missing in the database.

Look into your php.ini and make sure that the save_path isn't commented or missing:
session.save_path = "C:\wamp\tmp"
Create the folder C:\wamp\tmp first, change php.ini, then restart wamp.

Related

Symfony SessionHandler Warning

when I try to run a especifical project on my computer, symfony show me this error:
Warning: SessionHandler::read(): open(/opt/alt/php74/var/lib/php/session\sess_rt7p5374uhjagiperqv83aej38, O_RDWR) failed: No such file or directory (2)
I'm use symfony 5.4 and PHP 8
I found this line session.save_path = "/opt/alt/php74/var/lib/php/session"
in .user.ini file and I changed it and now it's working
There is nothing wrong with Symfony's side. You can set proper path at session.save_path in your php.ini
session.save_path = "/path/to/your/folder"
The folder you use should be under your domain/account but not accessible through a Web browser. It also needs to have world-writable permissions on it based on user/role.

session.save_path shows 'no value' in phpinfo() even after setting it in php.ini file.

I was getting this error upon starting phpmyadmin on macOS High Sierra:
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
Later I found out that the session.save_path was set to "/Applications/XAMPP/xamppfiles/temp" but the phpinfo() displayed:
session.save_path no value no value
I tested it by changing the path to another directory but it did not work and I am still getting the same 'no value'.
As a result I am unable to use session functions in any project.
You cat set session save path before running session start function, in you php application, for example:
ini_set('session.save_path','/var/tmp/');
OR
session_save_path('/var/tmp/');
OR in php.ini file:
session.save_path = "/var/tmp/"

Memcached failing after PHP upgrade

I have been using memcached and I upgraded from PHP 5.4 to 5.6 and now it is failing to connect and store.
I have:
ini_set('session.save_handler', 'memcached');
ini_set('session.save_path', 'serverAddress:11211');
session_start();
I have also tried tcp:// before the server address, but no luck there.
In the error log, I am getting the following errors:
PHP Warning: session_start(): Write of lock failed
PHP Warning: session_start(): Unable to clear session lock record
PHP Warning: Unknown: Failed to write session data (memcached).
Please verify that the current setting of session.save_path is
correct
I guess something changed in the versions of PHP. Any help is appreciated, thanks!
Note: I am using Amazon Elastic Beanstalk for the web server and ElastiCache for the memcached
What I Have Tried
Used a config file with:
files:
"/etc/php.d/setup.ini":
mode: "000644"
owner: root
group: root
source: https://s3.amazonaws.com/path/to/file.ini
Inside of the ini file is:
[php]
session.save_handler = memcached
session.save_path = 'memcached.server.path.cache.amazonaws.com:11211'
I have tried using session_write_close()
I have tried using tcp:// before the server path
I have also tried using memcache instead of memcached as the
handler.

php Set tmp directory

I have an Apache server running on RHEL 6.5. For the past few days I have been trying to install OSticket, an open source ticket system, and keep getting this error when trying to access the setup directory with my browser.
Warning: session_start() [function.session-start]: open_basedir
restriction in effect. File(/tmp) is not within the allowed path(s):
(/u00/apache_homes/sdm/:.:/u00/app/php/lib/php/) in
/u00/apache_homes/sdm/htdocs/support/setup/setup.inc.php on line 53
Fatal error: session_start() [function.session-start]: Failed to
initialize storage module: files (path: ) in
/u00/apache_homes/sdm/htdocs/support/setup/setup.inc.php on line 53
Now I know the issue is that the page dose not have permission to access the /tmp directory. I cannot give it access for security reasons according to the server admin. We do have another tmp directory set up under the Apache folder.
My question is this. Is it possible to specify a override to use this new directory globally as the tmp directory? Is it upload_tmp_dir in the php.ini what I am looking for?

php.ini.default not finding new path to cloudfusion on Mac OS X Snow Leopard

I'm trying to follow along with a book on Amazon EC2 and it says to include a new file path in php.ini in the etc folder to the cloudfusion sdk. So I uncommented the path variable in php.ini.default and set the new path to be:
include_path = ".:/php/includes:/Users/john/cloudfusion"
but yet when I try running my php script inside a folder named amazon, it keeps giving me the error:
Warning: require_once(sdk.class.php): failed to open stream: No such file or directory in /Users/john/amazon/create_bucket.php on line 26
Fatal error: require_once(): Failed opening required 'sdk.class.php' (include_path='.:') in /Users/john/amazon/create_bucket.php on line 26
Anybody have any ideas?
PHP doesn't read php.ini.default, it just defaults to the values in it internally, to make sure your changes are read, you can copy that file to php.ini and edit your values.
Alternatively you can use http://nl3.php.net/ini_set function to modify your include path on-the-fly. You need to use ini_set before the actual require_once.

Categories