What is the normal mode for directory /var/cpanel
I am troubleshooting an issue with the CiviCRM plugin in WordPress on a Bluehost server.
I notice Civi functionality is failing to read session data at /var/cpanel/php/sessions/ea-php81.
I notice the attributes on the "/var/cpanel" directory are:
- mode: 711 (ie: drwx--x--x)
- owner: root
- group: root
Is the "/var/cpanel" directory created by your cPanel product? If so, is 711 mode normal, or should the mode be 755 (ie: drwxr-xr-x)?
-
Hey there! Yes, this is a directory that is created by us, and it should be the 711 root:root like you are seeing.
0 -
Thanks cPRex - OK, so that is a dead end and we will have to find another hint. I will ask CiviCRM if they have a theory why their plugin is tricked into accessing that directory.
I am curious - what RPM package creates that directory?
0 -
That directory isn't created by any specific package, but is part of the installer itself.
0 -
I have a little more data on this issue I am troubleshooting. I am at the point where Civi support says Bluehost is wrong, and Bluehost support says Civi is wrong. I am hoping you can help break the tie.
This is the "save_path" directory I see when I run the following command on my Bluehost server:
php -i | grep save_path
session.save_path => /var/cpanel/php/sessions/ea-php81 => /var/cpanel/php/sessions/ea-php81
However, that directory seems to be inaccessible, for example I get an error when I run this command on my Bluehost server:
ls -ld /var/cpanel/php/sessions/ea-php81
/bin/ls: cannot access /var/cpanel/php/sessions/ea-php81: No such file or directory
I assume this directory is created by cPanel and wish you to let me know the expected behavior.
I have very little privileges to dig deeper, and Bluehost support can not (or will not) help. Here is what I have learned so far: the 'sessions' subdirectory has the same owner/mode as your "cpanel" subdirectory, specifically:ls -ld /var/cpanel/php/sessions
drwx--x--x 11 root root 4096 Jul 22 2020 /var/cpanel/php/sessions/The above mode prevents me from viewing objects under the "sessions" subdirectory, but by a stroke of luck, I found another "save_path" that is accessible, specifically:
ls -ld /var/cpanel/php/sessions/ea-php74
drwx-wx-wt 2 root root 425984 Mar 20 12:43 /var/cpanel/php/sessions/ea-php74/This makes me wonder if "ea-php81" should also be accessible (similar to "ea-php74"). Please confirm.
0 -
When you are running "php" on the command line, that will be the default command-line version and may not correlate to what you expect to see on an account.
But no, I would not expect a normal user to be able to see much under /var/cpanel/.
What specifically are you trying to do?
0 -
Background: I am working with CiviCRM to get their product working on my Bluehost server, but we are experiencing this error:
[19-Mar-2024 23:32:34 UTC] PHP Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php81) in /home4/uvfousor/public_html/wp-content/plugins/civicrm/civicrm.php on line 494
I am trying to learn if that error is because "ea-php81" is missing, or something else. I have a separate post with the Bluehost support team, but they seem lost and I am hoping to give them specific instructions to fix this issue.I would also like to learn who (or what) is responsible for creating the full path specified in the "save_path" variable, particularly the one under the /var/cpanel directory structure.
0 -
I can confirm that is the correct path for PHP to use for the sessions, and the cPanel users will have access to that specific area under /var/cpanel/. You can confirm this in a browser by creating a PHP Info page and you'll see that session.save_path variable there.
/var/cpanel/php/sessions should be 711 root:root and all directories inside of sessions have the following sticky-bit permissions:
drwx-wx-wt. 2 root root 4.0K Jun 15 2023 ea-php81
0 -
My fault for not being clear - Let me ask the question differently.
I am assuming the "ea-php81" directory is missing - If this is true, what needs to be done to (re)create it?0 -
The only reason that directory would be missing is if that version of PHP isn't installed, which is unlikely.
0 -
I am not sure we are on the same page. I know PHP 8.1 is installed and I see phpinfo() return the "session.save_path" value, specifically: /var/cpanel/php/sessions/ea-php82
But I suspect the "ea-php82" subdirectory is missing on the host. I am trying to check it with the following command:
ls -ld /var/cpanel/php/sessions/ea-php81
But the above command is failing. Should I be using a different way to test "ea-php81" is missing?0 -
I don't think that's going to work - are you checking this as a cPanel user and not root?
0 -
Correct, I am a non-root user - I do not have access to su (or sudo).
But I can switch between PHP versions. When I do the same with PHP7.4, I am able to view the save_path value, for example:uvfousor@uv4sor.org [~]# id
uid=2613(uvfousor) gid=2613(uvfousor) groups=2613(uvfousor)uvfousor@uv4sor.org [~/www/wp-admin]# ls -ld /var/cpanel/php/sessions/ea-php74
drwx-wx-wt 2 root root 425984 Mar 21 14:18 /var/cpanel/php/sessions/ea-php74/
I assume the same behavior with PHP8.1 - but because I don't see the same, it makes me suspect something is wrong. Does this make sense?0 -
Thanks for the clarification - yes, that would seem that something is off with the PHP 8.1 version if you can't even view that path as the user.
0 -
So, that is why I ask what needs to be done to (re)create it?
0 -
I honestly have no idea - it shouldn't not exist in the first place :D
I would expect your host to be able to figure that out. If not, they'd need to submit a ticket to us.
0 -
OK, I am working with the support team for my host (ie: Bluehost). Progress with that team is slow and I was trying to help them along. I guess I just need to learn to be more patient (smile).
0
Please sign in to leave a comment.
Comments
16 comments