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.

Warning: session_start

Discussion in 'Database Discussions' started by msmagoo2, Jan 29, 2009.

  1. msmagoo2

    msmagoo2 Member

    Joined:
    Jan 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I'm new to PHP & MySQL and received the following errors after I uploaded the site to my remote server. The site works fine except when trying to access the db on the shopping pages. I get the following errors:

    Warning: session_start() [function.session-start]: open_basedir restriction in effect. File(/var/tmp/) is not within the allowed path(s): (/home/xxxxx:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/xxxxx/public_html/WA_eCart_Definition_PHP.php on line 479

    Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/xxxxx/public_html/WA_eCart_Definition_PHP.php on line 479

    I'm unable to edit the php.ini files on the remote server (it uses cpanel) & they claim it's a problem w/ the script in the cart software. The cart software people say it's a problem w/ the open_basedir setting that I cannot change. And I'm in the middle. I've searched the web and I'm not the only one w/ this problem but the answers/solutions are all over the place. :confused:

    Any thoughts/suggestions/help is greatly appreciated. :p
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This may be an issue that can be resolved through coding rather than affecting the server's configuration (which you don't seem to have root access to).

    Many PHP scripts have a setting for a temporary directory (also known as a temp or tmp directory). Perhaps the setting for this script is set to /var/tmp by default rather than ~/tmp or /tmp. If the script you are using was designed for a shared hosting environment, this setting is likely configurable.
     
  3. msmagoo2

    msmagoo2 Member

    Joined:
    Jan 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    "Warning: session_start"

    Thanks, David. You gave me some places to look!

    On my local server the session.save_path is set to tmp in the php.ini and all pages work fine in the local environment. But on the remote server (using cpanel) where does the /var/tmp/ come from? Is it the from the php running on cpanel? Or do I somehow upload it w/ my site pages, scripts or db?

    Also, when I check the variables on MySQL phpMyAdmin under cpanel it shows the bdb tmpdir, slave load tmpdir and tmpdir as /var/tmp/. Again, where (who) does this setting come from? I'd be most happy to change it if I know where/how to.

    Many, many thanks for your kind reply.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Is this information being provided by phpinfo() or some other mechanism?

    cPanel/WHM does not itself insert configuration data into user databases. If your databases are showing settings for tmpdir, those would have been set by the script you are using rather than cPanel/WHM.
     
  5. Kailash1

    Kailash1 Well-Known Member

    Joined:
    Nov 27, 2006
    Messages:
    252
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Try to add following line in your .htaccess and check whether it works or not:

    Code:
    php_value include_path ".:/home/xxxxx:/usr/lib/php:/usr/local/lib/php:/tmp:/var/tmp/"
    replace xxxxx with your username.

    Kailash
     
  6. msmagoo2

    msmagoo2 Member

    Joined:
    Jan 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, Kailash. I copied the code into .htaccess and changed the xxxxx to the user name. Alas, I still get the same error. But I really appreciate the effort.

    David - On my local server (my laptop) the session.save_path that is set to tmp is in the php.ini file that was downloaded w/ php. All works fine there. I can change/set it to whatever on my laptop. The problem came when I uploaded to the remote server that is using cpanel. Then I get the /var/tmp error and the host won't let me change the php.ini file.

    Thanks for all your help. I've gotten more reponse from ya'll than anywhere else I've looked. You ROCK!!!
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Typically, the value of session.save_path in php.ini is of no concern to the PHP script (as that's handled internally by PHP). If this is giving you issues, I recommend contacting the hosting provider to ensure that path has proper ownership/permissions set so PHP scripts that rely on sessions can save their temporary data successfully.
     
  8. msmagoo2

    msmagoo2 Member

    Joined:
    Jan 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    "Warning: session_start"

    I checked another site I have access to on the remote server but that has no database or php/MySQL running.

    Under cpanel/MySQL/phpMyAdmin/information_schema the bdb tmpdir, slave load tmpdir and tmpdir is all set to /var/tmp/ even though I have no php/MySQL loaded on this site. Where/who/how would these settings already be set under the schema? Where would I/the host change them? Am I totally out of the ballpark w/ this line of thinking?:eek:

    Many, many thanks!
     
  9. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    If you accessed that database via the cPanel interface, that would be a database that was created by your application. That means your web application is governing those settings, not cPanel/WHM. cPanel/WHM does not create an information_schema table nor database in user accounts.
     
  10. msmagoo2

    msmagoo2 Member

    Joined:
    Jan 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, David.

    I didn't create a db for the site I looked at w/ no PHP/MySQL running. When I go to cpanel interface/MySQL/phpMyAdmin for that site it has no db, just the schema. The only way the schema could have gotten there (if it is not created by cpanel or MySQL or, perhaps, DW, which I used to create that site) is when I uploaded the other sites w/ PHP/MySQL and the db. It seems odd that the schema would also be there for other sites w/ completely different username and passwords and no db, no PHP, no MySQL.

    I'll ask the host to delete the schema since I can't, believe me I've tried, and try to build the db on the host's site.:( But the schema might be (probably is) in the script somewhere/somehow and I might be stuck in this loop again.

    I do appreciate all your help/time/knowledge. Have a blessed day.:)
     
Loading...

Share This Page