[help] Fatal error: session_start()

Discussion in 'PHP' started by trixy, Sep 17, 2012.

  1. #1
    I got this message when activate my theme

    Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/myhost11/public_html/wp-content/themes/theme1121/library/functions/general_functions.php on line 2


    general_functions.php contain this script

    
    
    1. <?php 
    2. session_start();
    3. ob_start();
    4. if (!class_exists('General')) {
    5.	class General {
    6.		// Class initialization
    7.		function General() {
    8.		}
    9.
    .
    .
    
    Code (markup):
    anyone know how to fix it?
     
    Solved! View solution.
    trixy, Sep 17, 2012 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    What's the server's session storage path set to? You can find this with phpinfo(). My first guess is that you have a non writable storage location.
     
    jestep, Sep 18, 2012 IP
  3. Poppers

    Poppers Member

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    28
    #3
    Second the above, sounds like non writable path.
     
    Poppers, Sep 18, 2012 IP
  4. trixy

    trixy Active Member

    Messages:
    177
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #4
    yes it's about non writable storage, but I don't know which part is non writable, is it the root or the directory where I install wordpress?
     
    trixy, Sep 18, 2012 IP
  5. #5
    Typically session storage is on /tmp or something similar. Use phpinfo, and look for session.save_path. You can manually set this if necessary, but you need to be careful as it can pose a security risk if you store sessions in a public or web accessible directory.

    This has nothing to do with wordpress, this is a server configuration issue. Wordpress simply uses the compiled php build and configuration which is what handles the sessions.
     
    jestep, Sep 19, 2012 IP