The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP upgrade causing session errors

Discussion in 'General Discussion' started by iToke, May 24, 2011.

  1. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Hi guys,
    I have a dedicated Linux server and have just updated the PHP to 5.3.6, everything went without problems except when accessing more than 1 site that has a temporary URL e.g 172.11.11.11/~username
    I keep getting the following errors when I open a second or more sites using the temp URL -

    Warning: session_start() [function.session-start]: open(/tmp/sess_c1fded4011824be13e39f14e4c41c572, O_RDWR) failed: Permission denied...

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent...

    Warning: Unknown: open(/tmp/sess_c1fded4011824be13e39f14e4c41c572, O_RDWR) failed: Permission denied.....

    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 it was a session save path issue, it's set to /tmp which does exist.
    Session auto start is set to 0, I tried to change it to 1 and it didn't seem to save this setting.

    The PHP 5 handler is suphp, Apache suEXEC is on.

    Any ideas?
    Thanks
     
    #1 iToke, May 24, 2011
    Last edited: May 24, 2011
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Try clearing out the already existing session files in /tmp location to see if the issue resolves. You could specifically clear the session it notes. Normally, it involves an already existing session that hasn't cleared when some change is made to PHP, making the session no longer valid but it still exists and your system isn't clearing it. If you remove the existing session file, your system should start a new session.
     
  3. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    thanks for the reply,
    I'm pretty new to all this server stuff! How do I clear out the /tmp folder. I've managed to use putty to SSH into the server, but don't really know what I'm doing!
     
  4. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    I've managed to empty the tmp folder using putty command rm -rf * , but the problem still persists.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please do not use rm -rf * in a folder if at all possible. It would have been simply:

    Code:
    cd /tmp
    rm sess_c1fded4011824be13e39f14e4c41c572
    If you removed all the contents in the /tmp folder, it's possible that the MySQL symlinked socket file will have been removed. Better to wait for a reply than using a command that empties the entire contents of /tmp folder.

    If the issue is still occurring, please open up a ticket for us to see after checking if you get the same error in another browser and clearing your current browser's cache.
     
  6. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    I've checked to see if the problem occurs in another browser and it does, tried Chrome, IE & Safari. Usually use FF4 which clears the cache on exit anyway. I've actually rebuilt the PHP to 5.3.6 & upgraded Apache to 2.2 and then rebooted the server to no avail.
    Here are 2 sites on a temp URL so you can see the problem -
    /http://79.170.43.172/~happyfee/
    /http://79.170.43.172/~pigwidge/

    We rent our server from Heart internet, unfortunately, the server does not come with support from Heart, so I'm pretty much left to fend for myself as my friend who rented it knows even less than me!
    Thanks for any help.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We provide support for anyone who has a cPanel license with root SSH and root WHM access to the machine. As such, please open up a ticket with us if you have the necessary login details that can be provided in the ticket.
     
  8. iToke

    iToke Active Member

    Joined:
    Sep 23, 2010
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Tristan, I've submitted a support ticket.
     
  9. smartscript

    smartscript Registered

    Joined:
    Aug 12, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Did you find a solution to this issue, as i'm having exactly the same problem?

    Thanks in advance.
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Are you using temporary urls at this time for the accounts? The issue was caused by the user using the IP/~username url temporarily upon moving accounts. Under suPHP, the sessions are supposed to be owned by the user running the process. When using the temporary url for the IP or hostname, you are attempting to save sessions for different users under /tmp which causes an error for the session.save_path location.

    Normally, this will only occur under suPHP + using mod_userdir (the temporary url). You could simply disregard the error in the meantime, or you could add the domain to your computer's hosts file in order to see it resolving on that server rather than using the temporary url to view it.
     
  11. tinboye22

    tinboye22 Active Member

    Joined:
    Sep 16, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    I am having a similar issue, but here is my scenario. I updated my servers php to 5.3.8 and running apache 2.2

    I used easyapache to do the rebuild
    I added XLS and php eccelerator to the build

    then once done I switched php 5 to DSO and php 4 to CGI, before they were the otherway around.

    After doing this all permissions for every file on my server is wrong.

    the tmp folder says its 1777 yet i get the write permission error

    when I ftp into 1 of my sites

    it says permission on folder is 755 for owner/group its 577/572 not sure if this is write for owner/group

    but it seems every file/folder for the entire server is experiencing the write issue.

    and I cannot find any reference on how to remedy this. I even rebuilt apache after switching php 5 to DSO and php 4 to CGI
    permissions still show the same, when i check them, it still says they are not writable.

    I also get something like this

    You (nobody) are not allowed to use this program (crontab)
    See crontab(1) for more information


    help please!!
     
  12. tinboye22

    tinboye22 Active Member

    Joined:
    Sep 16, 2004
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    well i discovered that php 5 and DSO with cpanel do not work together as dso uses nobody for permissions. so i switched back to suphp which is a shame being that dso mod_php is much faster
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    DSO will work with PHP 5 on cPanel. You simply need to have high enough permissions for your files or folders.
     
  14. Payback

    Payback Member

    Joined:
    Apr 16, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    So how did you resolve this issue?
    Im guessing mine was caused by i accidently doing some alterations while on the Ip rather than the domain name?

    TMP is set to 1777
     
    #14 Payback, Apr 18, 2012
    Last edited: Apr 18, 2012
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Are you using suPHP and the temporary url (IP#/~username)?
     
  16. Payback

    Payback Member

    Joined:
    Apr 16, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    No idea what suPHP is but i accidently used the temp url, but it seems like it fixed it self over night?
     
  17. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    suPHP is a PHP handler. As I previously stated in this forum thread, you cannot create sessions when using suPHP + the temporary url.

    The PHP handler version is available to view in WHM > Apache Configuration > PHP and SuExec Configuration area, although it would most likely require having WHM root level access to see.
     
Loading...

Share This Page