Page 1 of 1

PHP Session not configured correctly on the server HELP!

Posted: Thu Jul 16, 2009 9:44 am
by Rocko123
Guys,
I am new to Apatchi, Linux and PHP. I have a dedicated server with Centos. I installed PHP 5.2x and mysql 5.x. I have plesk control panel on there as well. When I try to run my php application on it, it does not seem to retain the session. this application run on shared hosting environment like a charm. I am sure its session problem becuase in the error message I can see that its not retaining some values in my URL. I checked the php.ini file and I looked at the session settings. Here is what I did,

changed the session.save_path = "N;/path" to /tmp and granted tmp full permissions 777 on the root. That did'nt work.

in plesk panel ther in the "web hosting settings" i enabled php support I picked the module option, CGI and Fast CGI did not work. ( I am not sure if this has anythign to do with it)

more info

- The code files are in the httpdocs folder the chmod 777 on that folder as well.

- Plesk panel version is 9.2

- old old version of php I think 2.x was intalled on the server when I got it.

- Hosting company has no clue whats going on, its dedicated server, my own, i can do whatever i want to it. I have full access to and they only provide it with the basics.

Can anyone help me or give me hints on what could be the problem with the session? and/or whats the proper way to configure the php session on my server?

Re: PHP Session not configured correctly on the server HELP!

Posted: Thu Jul 16, 2009 9:55 am
by jackpf
Have you got error reporting turned on in php.ini?

Also, try a simple script like this.

Code: Select all

//on page 1
session_start();
$_SESSION['blah'] = 'blah';
echo '<a href="page2.php">clicky</a>';
//on page 2
session_start();
print_r($_SESSION);

Re: PHP Session not configured correctly on the server HELP!

Posted: Thu Jul 16, 2009 10:11 am
by Rocko123
Yes, I have error reporting on thats what I get from the log.

[Thu Jul 16 01:18:26 2009] [error] [client 74.208.171.210] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/vhosts/default-domain.com/httpdocs/install/lang//lang.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/default-domain.com/httpdocs/install/index.php on line 562

notice the two slashes, that path should be '/var/www/vhosts/default-domain.com/httpdocs/install/lang/en/lang.inc.php' where en is a value that is kept in session, which means its not being retained.

the application installs and works great on shared hosting environment, same code. I just can't configure it correctly on this dedicated server environment.

Re: PHP Session not configured correctly on the server HELP!

Posted: Thu Jul 16, 2009 10:51 am
by jackpf
So the sessions are set in this include file that isn't being included?

What's the code you are using to include the file?