Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: PHP Session Error?

  1. #1
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    851

    Default PHP Session Error?

    We have an Opensuse 11.0 server running Apache, PHP and MySQL. We have several little gadget applications written in PHP that access that SQL database.

    The PHP session files on my Opensuse 11.0/Apache server are created in /var/lib/php5. Something keeps changing the permssions on that folder (when the server is restarted?). The symptom is obvious: when we browse to one of our app pages, we get startup errors; the logs show "unable to create/access session file(s)." I'll go in with SSH and sure enough, /var/lib/php5 will have changed to root/root ownership/group. I'll change it back to apache/apache and everything will be fine.

    Any ideas? What could be changing the ownership on that directory without my knowledge? I've done a quick grep through /etc and I've glanced at the cron jobs, but didn't see anything obvious.

  2. #2
    ab@novell.com NNTP User

    Default Re: PHP Session Error?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On my SLES 11 system I have wwwrun:root as the owners despite a few
    reboots. I would suggest finding out what could possibly modify that on
    your system.... if you've setup any cron jobs, disable them for now. Any
    startup scripts? Check them out too. You could potentially enable
    filesystem auditing as well to see if it will catch the userid making the
    change.

    Good luck.





    smpoole7 wrote:
    > We have an Opensuse 11.0 server running Apache, PHP and MySQL. We have
    > several little gadget applications written in PHP that access that SQL
    > database.
    >
    > The PHP session files on my Opensuse 11.0/Apache server are created in
    > /var/lib/php5. Something keeps changing the permssions on that folder
    > (when the server is restarted?). The symptom is obvious: when we browse
    > to one of our app pages, we get startup errors; the logs show "unable to
    > create/access session file(s)." I'll go in with SSH and sure enough,
    > /var/lib/php5 will have changed to root/root ownership/group. I'll
    > change it back to apache/apache and everything will be fine.
    >
    > Any ideas? What could be changing the ownership on that directory
    > without my knowledge? I've done a quick grep through /etc and I've
    > glanced at the cron jobs, but didn't see anything obvious.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ2ihyAAoJEF+XTK08PnB5YCsP/iWfUjOtoJgZAX7MchROl9FF
    6IHkjKikfp0A4CfKYEvh7HF/+LcwDTb0d7wi/+I9l+istpY/RXng0gWFA8Zmk5JO
    QvOxgiUjfF/I+UlCLwKBM/BF1KMY8JIfNjD/21kKGy2qL0ycYRM2z8gJVanSje/3
    /LIShzMT4qb1ajtPjUKeL3sd9vsYEiRkjGOEPkOK2XCYzG1YrWAfprzoMnl6Bz7t
    mHwbM1ByzpWFX3/VirTC+lVx5WOSGiJUyLbpnglqwm54F2cDlz5EFNaSZqvnG4b7
    MzHSql44WHNFFc9/289sDvjLvYiam0LmA5NRv7hPgOO2+6NFvD3+kw50fel4zCrf
    VDxyFP5w2T4q26ag5ZXWBz8SBkWdU+1n9l3NIBtHmyBBlvRzwPber7CUzQIdNY9B
    Hw9mucQMd5V43ZtBWc+IbTAYR2SUw9wu3fQlII4yQgehFQM3FX4e4lymXVsT3jJk
    zeUbLGersLtkbjvTp4DKcfbk7PKobey8i6V7gEgcYupRcv9k9pHT2tDsHrkHWse3
    InPN0CpaJ/wqUHKC7f9fotDTmBFDhuW2yLS9Aa0gb32D+q3GRhXp/gCIq8/iae0D
    Mafqnp6xcxN5NEnSXCkRkNADaOe/xJ7wiG+OgswrEpochATB13uizeIDjbeVPF0K
    jNXcU9A3sAfhXTCV6M/F
    =QRws
    -----END PGP SIGNATURE-----

  3. #3
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    851

    Default Re: PHP Session Error?

    Quote Originally Posted by ab@novell.com View Post
    On my SLES 11 system I have wwwrun:root as the owners despite a few
    reboots. I would suggest finding out what could possibly modify that on your system.... if you've setup any cron jobs, disable them for now.
    The only cron job is a simple rsync that does a nightly backup. As I mentioned above (but without details), I've looked through /etc/php5, etc/apache2 and at the startup scripts in init.d and haven't found anything obvious.

    I was hoping that someone here had experienced this and knew where a stray "chown" might have buried itself. Since it seems to be happening at reboot, I'm concentrating on boot and init scripts.
    Last edited by smpoole7; 06-Apr-2009 at 09:54. Reason: corrected "chmod" to "chown"

  4. #4
    ab@novell.com NNTP User

    Default Re: PHP Session Error?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    If it reliably happens on reboot does it also reliably happen on restart
    of apache2? PHP doesn't, afaik, have any scripts of its own that would be
    involved.

    Good luck.





    smpoole7 wrote:
    > ab@novell.com;1968993 Wrote:
    >> On my SLES 11 system I have wwwrun:root as the owners despite a few
    >> reboots. I would suggest finding out what could possibly modify that
    >> on your system.... if you've setup any cron jobs, disable them for now.

    >
    > The only cron job is a simple rsync that does a nightly backup. As I
    > mentioned above (but without details), I've looked through /etc/php5,
    > etc/apache2 and at the startup scripts in init.d and haven't found
    > anything obvious.
    >
    > I was hoping that someone here had experienced this and knew where a
    > stray "chown" might have buried itself. Since it seems to be happening
    > at reboot, I'm concentrating on boot and init scripts.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ2jV+AAoJEF+XTK08PnB5mf4QAKrqynHAHs8WL0FDl7mJ72ZA
    B/4sg5VMgNJ6L2NPFyWfjK/1c6yn6MTRs76suh1aEzkth2qlCBJrps7yFLG2WtvU
    KbyyiLi19CDQMM0gvoMQ0z/Cw0NuAX2T5IRRHBpfGydRKx6lqctkFT/3WLk/UrgO
    ZcestsJTnLGtpuBwpXK1dVLBvRoPWIn0RSAa8W1fZzYqAGVY+jUiy/EXgZ2ueifW
    /kvy7OXxBqrxZN781/e1pYbkwHIL5T6E5659vniqoTREehuB5zCbPlwJ1UfojqEA
    HsNIvlMqK7BkC1oeYwA+r5oX4ta6tKM4hxFvYyPjTxpi2JfcO0ZLXWzOPfSOf1zn
    gpPgDwxG1/rl7Bq5g1DMC4Qvp4Z9RaU/B/XqYLOGeMHT2hcVcx97Z9saeBYQqfy/
    QsIyk+S64DvtBbpRSDkrJM4BfEDXrgq9LITnlE5qgWMkcefWzQMPOPMTK7RaebQW
    ero3OVheW3JshFE2sxjSff9lttVSgXJbMDi1nVTjzzmVpJWdnQBe9OqUvyz3yjt+
    YelK3RY/nGQhBGKex1vHKDPaGBBhQlrDkm1uBODbYeNN/UcdwqYzO85dD0GIJEin
    CC4SmC8DVFYo26KalKM/MNEXvuwt6JyWTHLLkMDkfVk9yzgOcKfBa4HSa2ocnCmu
    /bl38aUoPhQ5UKjSW8/S
    =qgMp
    -----END PGP SIGNATURE-----

  5. #5
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    851

    Default Re: PHP Session Error?

    Quote Originally Posted by ab@novell.com View Post
    If it reliably happens on reboot does it also reliably happen on restart of apache2? PHP doesn't, afaik, have any scripts of its own that would be involved.
    Reboot this time didn't do it, restart of Apache2 didn't do it ... but here's a clue: we're set up for automatic updates. The logs show that a PHP update was installed on 04-05. The problem appeared this morning. That may have been the cause.

  6. #6
    ab@novell.com NNTP User

    Default Re: PHP Session Error?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    rpm -V <thePackageName>

    for example

    rpm -V php5

    Post the output, please.

    Good luck.





    smpoole7 wrote:
    > ab@novell.com;1969015 Wrote:
    >> If it reliably happens on reboot does it also reliably happen on restart
    >> of apache2? PHP doesn't, afaik, have any scripts of its own that would
    >> be involved.

    >
    > Reboot this time didn't do it, restart of Apache2 didn't do it ... but
    > here's a clue: we're set up for automatic updates. The logs show that a
    > PHP update was installed on 04-05. The problem appeared this morning.
    > That may have been the cause.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ2ktXAAoJEF+XTK08PnB5dt4QAMGyZNBQsuhhvEYDtN972X6z
    SrZFH94uy2ImLfOglOwbO9znA0zrfjbTovgCNHZSZAG/28GCDAKEAGZWr7XhRMOV
    oS4okEzANuEvbdnO/LbUIN+DkEoGkAY/DZFq6nSSpqZx/GXeM4+9e3U9XFPsY8vc
    kwGQzHmic82FzWWOzpnW5I/nipnVyuD+366rn6wp6b+WRtJZCd6uwyiKDjuW6N3W
    RiXkcI9ucdZexQNpDK2dcLXxFCUIYNmHl6Qm2HkHDEbaM2MBihaioCB0weJg8OD7
    0rC+koCRlyGM6zN7AI3hsHZHc+g3mwKQ+MDRKaBCm8QF5xaXou3ocWlDE6P2wkNz
    55Tb7T8bi74jbw+uHmIeLC6cQaekBXqVvfOOGEHMAcEgTHtCmD43wCLMwDeVY09p
    x4GUIhI6i93h4ZZ//Yr5S5qhyYmDdXzohoojUI2xOoWF8LAOHg666n5qsbzwwFkq
    OOEaIAa5NAIYVfGboVwURAS4euaTbJELiZvv0Q2SJmotOrEMudWfkoInXkPMwpbJ
    L0+UweVZoO8YSSY2gtwHRn9vzhQ61NhruGmsf9qh4uG7dyPKBuihA89lUmiOZnOC
    0F5/aN8tuSsymJ4rZJquMku35C3wV5Bz0GsMVhZKs0LRpHWps/G+lfsVoVlYO3mW
    qRbSKV/HGeYqe1Pwt6rg
    =IsWv
    -----END PGP SIGNATURE-----

  7. #7
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    851

    Default Re: PHP Session Error?

    Heh, heh! Well, look at that:

    Code:
    www:~ # rpm -V php5
    S.5....T  c /etc/php5/cli/php.ini
    .M...UG.    /var/lib/php5
    I solved my problem for now by simply inserting a cron job that resets ownership of /var/lib/php5 every morning at 1AM. Clunky and ugly, but it does the trick.

  8. #8
    ab@novell.com NNTP User

    Default Re: PHP Session Error?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hmmm........ well at least we know it's not the RPM (or at least not the
    files/directories as stored in the RPM) but that doesn't help us find what
    is causing this, really. Oh well.... I guess you can go from there but if
    you find the root of the problem please let us know.

    Good luck.





    smpoole7 wrote:
    > Heh, heh! Well, look at that:
    >
    >
    > Code:
    > --------------------
    >
    > www:~ # rpm -V php5
    > S.5....T c /etc/php5/cli/php.ini
    > .M...UG. /var/lib/php5
    >
    > --------------------
    >
    >
    > I solved my problem for now by simply inserting a cron job that resets
    > ownership of /var/lib/php5 every morning at 1AM. Clunky and ugly, but it
    > does the trick.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ21/MAAoJEF+XTK08PnB5+58P/RYLiIDsDI7c1mv4/cXU5RIh
    lUS1LewPmHQUkFKpdFVBj8HQWsHMNOHa20yl0kb6QlwR6GJcNy4JlIelDBSi8kyZ
    AfbG0aEpfpm8PwQ07UAa3BV8bsuqLhnynMhdo3Rqwv5CNQsKpB+flVJxfhNBEC1l
    nfibFiDparrvGsUuQ3+Q6VBf/P7N+iyWchXPhJs11n39CMP7ZI+RaMTiyih5cQU1
    /k3+/jXCMMPZUuvXmCmwL7e7IBHCgp982ftle0DcsygeP4oauNa9NXwt+Wgq7Gt7
    VK2qX1eX42TgCnRP8EnKKNVA9sgglGr4Ps0sHDrIcs+XapLH16/SM7Iu9y5hGEPF
    cz0cE/iSQYLmnlwAFXWISOxz38+/1wmE04jVibanGrsJzNec3EFvIqZd4af55LII
    /J27uAbdLHrP3mhiohUCNpQurEvB4qRL5tQbjeePK01kmnCK14/ETZgg0lAOZqzU
    2N1eirDdVPG77mFNVgwsafkG7nyNH3q3XvAJK+2L0XvGya7Z7//aHwVcTCaZH4nJ
    ogHNIhqs9GUo2W75Bx1eBg4YIEhhXBHqkeo4rXuNaq07Lei9N04W2Y93V2wAHBp2
    7kc+xbF0ADDHnBvsDhVXi5812ny/XrCbfPhsX8jhKMepKnZK7k1Z1851qttj/5KL
    u+nEsd6P6h7+Ny5fJ4px
    =jBRf
    -----END PGP SIGNATURE-----

  9. #9

    Default Re: PHP Session Error?

    Is it not in /etc/permission perhaps (Shrug) seems to be doing something with ownership.

    Though I would of thought grep would of found it. Either way is not permissions the elegant way of solving(Shrug).

    Just a random drive by posting, thinking aloud really.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  10. #10
    ab@novell.com NNTP User

    Default Re: PHP Session Error?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Yes, /etc/permissions stores some permissions, but I don't think those are
    changed with every load or even affect those systems. Also I don't see
    /var/lib/ntp in any of those files so probably not related to those.

    Your post reminded me of the line from Mrs. Doubtfire.... "...it was a
    drive-by fruiting..."

    Good luck.





    FeatherMonkey wrote:
    > Is it not in /etc/permission perhaps (Shrug) seems to be doing something
    > with ownership.
    >
    > Though I would of thought grep would of found it. Either way is not
    > permissions the elegant way of solving(Shrug).
    >
    > Just a random drive by posting, thinking aloud really.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJJ220aAAoJEF+XTK08PnB5o4MQAM4eyCKIlPja6ildOWXC3npC
    s1g1P/SOIOFOC/sZdaESVOfO9aGDptp8A0FTJ+DgeWbxphNBBv/5WDSUCgQnvDsc
    ccCNq1qfI+eAbfuaehqesqdqf1/HzvifBgG3+g7RfOlR8+SMLbw/d9bgLF3G1Voc
    BO7h/6rUf8kBwosaZyFiTI337HlQci1baQ2I6feRelfKLP2RaISI/vvoZTtIYCWx
    okQzIayor2tAfqJiPepWjzUwb8j2BWensFna75w0sERbfdGNw4eLODtKc0tXP0+t
    tAowzAEZBu6Nzg42WegGV0YViCzk3hFDlc7OnxBRtljWsNmZZKdRMETvlz4k9yq9
    pagrYmIVqmG7aFAUsSDTZuhzFNf0DZiKEVR8YE1GheP6bvAPLB1OB1dO7gU3pYCq
    wYtA4rXd3Jvdc7CN40g3MftiCRGTbVf2X5fThlokWY8l4SsZ1yC6T/w92rdnLWrJ
    pkLOcb+jI+Wb9LkelkrFJbHYudfDmUeGw5UqtukhLVvwjpcuUThN2lJMeXUQuYxK
    3w+xbcmJyeXcCFqzEsvgR96v4AT5BbaKPMWMUulV2s1Q8qpPSyUj5Y13xf0uQhp2
    GQqwhzN3wP/mcFeYRxpO1wE87ro4kFCG/y1mviI+EIcqIVtme414RSXdax7Jp9bq
    M3CC1M5YbDfJQycdqF40
    =a/X4
    -----END PGP SIGNATURE-----

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •