Session cannot be started, File name too long (36) - php

I have a php application (Apache , Php-fpm )on a RedHat server and I have the error when calling sesssion_start():
session_start(): open(/tmp/sess_CGr5ZiSQDdHxDm685fm5VX7,bPAfwVW841U9OKDZxObglASxB1uQFE,3csTnWpecsq7Nxvdw9NkZLvhEWs3lrLAWtLHWbMfcmK,G2vg9,i2cyHu6m1o,WsjMfKvcmkrYRQmbWqf,cz0O31IJdPSkwbXcsYldjiptc6UTTShW8TQb7-k2slvtt7GKEz5MVLofDg8TqP4bbBP7q24Wx,4Nh52sgpUfYwkycD3OJycyPbQFcKRfLR0yXVTToBfVKHlI, O_RDWR) failed: File name too long (36)
I have tried to change the session.save_path to /tmp, given the proper permissions, but no luck.
Has someone faced this issue? Any help is appreciated thanks

Adding this value to my php-fpm pool config (www.conf) solved the issue, thanks #mmh4all for helping
php_value['session.sid_length'] = xx
xx can be between 22 and 256. I used 30 in my case.

Related

How to fix intermittent PHP Fatal error: Unknown: Cannot find save handler '/var/lib/php/session' [duplicate]

This question already has an answer here:
Warning : session_start(): Cannot find save handler 's' - session startup failed
(1 answer)
Closed 3 years ago.
Very intermittently and rarely my Centos7 httpd 2.4.41 and php 5.6.40 server will half load a page. The PHP loads, but the CSS and JS includes get the error 'Connection Reset' in chrome and dump this error into the php error log.
PHP Fatal error: Unknown: Cannot find save handler '/var/lib/php/session'
I have checked permissions on the session files, and the server has plenty of space, the fact that it works most of the time makes my scratch my head.
I've tried switching to memcached but same issue.
Can anyone share any light on whats causing this error?
Or perhaps a way to stacktrace the httpd PID after the fatal error?
Thanks in advance guys.
This issue might be related to your session save path. If you are not precious on where to save the sessions.
edit your php.ini and change the following
we are using the /tmp directory here.
session.save_path = /tmp
more information can be found here
http://www.php.net/manual/en/session.configuration.php#ini.session.save-path

Sessions limited on server?

2011-12-08 17:24:04 - PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
2011-12-08 17:24:04 - PHP Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0
Getting these errors after uploading a certain amount of content. Also, noticed that can no longer log in to admin panel. Could this be cause by too many sessions be stored on a server? Or anyone have any other ideas? First happened after uploading a few images through admin panel in open cart.
I am hosting a bunch of sites off of one server. SO it seems likely but has anyone run into this before?
Looks very likely that you've run out of space on the disk and so causing many things to fail. Try freeing up some space and try again.

PHP: Session_start() directory does not exist error

I have looked around on the issue - but it seems that all I can find about it is people who are having the problem connecting to a local database or something (not really sure). I am having the problem on my website (any time I make an ajax call to a file that has a session_start())
Anyways, this is the error message I am getting:
Warning: session_start() [function.session-start]: open(/usr/local/apache/bin/httpd/sess_5840483107c1db9753c32214723b64a6, O_RDWR) failed: Not a directory (20) in /data/in/r/reiconsultants/www/employee/user_page_login.php on line 3
Warning: Unknown(): open(/usr/local/apache/bin/httpd/sess_5840483107c1db9753c32214723b64a6, O_RDWR) failed: Not a directory (20) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/usr/local/apache/bin/httpd) in Unknown on line 0
I haven't touched the code in a while - and I can be quite sure that no one else has either, so I am not sure why the error is occurring. I read a bunch about people going in and setting the php.ini file, but I have never had to do that before - and can't even find the file.
Like I said - the error is occurring on my company website, not when trying to connect to a local database.
The error just popped up today - I got flooded with emails about it, and it is on more than one web page being hosted on the server - all the pages I have that include a session_start() at the top have the issue.
Could it be a server side issue that I can't fix? or what...
sorry if I am not descriptive enough - I have absolutely no idea what is going on, and therefore don't know what to say. Just ask me for any clarification you need.
Thanks!
Paul
The error is indicating that /usr/local/apache/bin/httpd/ is set as your folder to save session data in. Does that folder exist and is writable by the user Apache is running as? Does the Linux server have any other security measures like SELinux running that might be stopping writing to that directory?
Did you verify that the current setting of session.save_path is correct? Is /usr/local/apache/bin/httpd correct folder for saving session data?
Try set session.save_path = "/tmp" in you php.ini to ensure that problem is in folder.
you can also change the session path at run time:
string session_save_path([string $path])

Failed to write session data

I received this message after long time of using the same application without programming changes:
Warning: Unknown(): write failed: No space left on device (28) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
I thought is servers problem, but these messages are not showing in every computer. Is this some sort of problem with settings? What can I do to fix this?
From Bytes.com
The filesystem containing /tmp is
full. Your system administrator should
fix this immediately - and if they
haven't noticed you ought to question
what level of support you're getting,
since a lot of things will go horribly
wrong if /tmp is full.
Source

Zend_Search_Lucene crashes during indexing

I wanted to create search engine for my webpage, but during indexing on server it crashes with errors :
Warning: opendir(/admin/lucene/) [function.opendir]: failed to open dir: Too many open files in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 159
Warning: readdir(): supplied argument is not a valid Directory resource in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 160
Warning: closedir(): supplied argument is not a valid Directory resource in /admin/includes/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 167
Fatal error: Ignoring exception from Zend_Search_Lucene_Proxy::__destruct() while an exception is already active (Uncaught Zend_Search_Lucene_Exception in /admin/includes/Zend/Search/Lucene/Storage/File/Filesystem.php on line 66) in /admin/test.php on line 549
I am using newest version of ZF. Is there code solution for such error - I run script on localhost and it works great.
Thanks for any help.
It seems the problem is in the large number of segments in the index.
Could you check how much files does index folder contain?
There are two ways to solve this problem:
a) Optimize index more often.
b) Use another MaxBufferedDocs/MergeFactor parameters. See Zend_Search_Lucene documentation for details.
If it doesn't help, please register JIRA issue for the problem.
PHP has hit the limit on the number of files it can have open at once it seems might be an option to change in php.ini, could be an OS (quota) limit or you might be able to tell the indexer to slow down and not have so many files open simultaneously.
This is most definitely a Linux/kernel imposed limitation. Use the following command as root on your machine:
cat /proc/sys/fs/file-nr
Return values are defined as:
Total allocated file descriptors
Total free allocated file descriptors
Maximum open file descriptors
I'm also going to take a guess and say you are on a shared hosting machine. If this is the case, I imagine that this sort of issue may come up frequently.
Finally, the following article provides a good amount of information on Linux and open file descriptors even if it is a little dated.
http://www.netadmintools.com/art295.html

Categories