Copy of phpbb3-forum not working correctly in virtual host

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Copy of phpbb3-forum not working correctly in virtual host

Postby surehand » 18. July 2011 12:39

Hi,
I just made a copy of our remote (hosted) site in XAMPP (locally) for development and testing purposes.
To do this I made a virtual host in XAMPP, with our domain name as servername, and with the website files in exactly the same file path as on the remote server.
After adjusting databases addresses and passwords to localhost, root etc, the complete site now runs smootly wihin the (local) XAMPP application, after typing the domain name
in internet explorer.
However, there is still a problem with the phpbb3-forum, you can't login. (more precisely: the login is partially completed: the forum mentions you in the list of
logged in registered users, but when you want to post a message, it says you have to login first)
I checked and rechecked the cookie settings for the forum but that does not seem to be the problem.
Any suggestions?
surehand
 
Posts: 4
Joined: 14. July 2011 18:23

Re: Copy of phpbb3-forum not working correctly in virtual ho

Postby Sharley » 18. July 2011 13:22

It sounds like there is a possibility that the php session files are not being read.

PHP sessions are stored and referenced in the \xampp\tmp folder, make sure that it has not been accidentally deleted or renamed by any cleanup utilities that you may have used - make sure that you exempt the whole xampp installation folder from any cleanup utility as XAMPP's components rely and use zero length files and many others that these utilities may delete.

You can read the cookies that are being stored in IE, so check that the cookies for a member logged in are actually being created and stored on your PC - have you tried another browser and do you get the same result?
This little portable app will allow you to view cookies in IE:
http://www.nirsoft.net/utils/iecookies.html
From this nice collection of browser tools:
http://www.nirsoft.net/web_browser_tools.html

Look in the \xampp\apache\logs\error.log and access.log files for possible clues.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Copy of phpbb3-forum not working correctly in virtual ho

Postby surehand » 18. July 2011 16:44

Hi Charley,

Thank you for your reaction.
Sessions seem to be ok, I inspected the location you named

Great tool your cookie viewer!
With it I compared the cookies generated by our site after a log-in on the hosted (correctly working) site,
and the local (not correctly working) site. After a login, in both cases three cookies are generated:

Hosted site (* is chosen cookiename)
phpbb3_*_k = empty
phpbb3_*_sid = string of numbers and characters
phpbb3_*_u = 1261

Local site (* is chosen cookiename)
phpbb3_*_k = empty
phpbb3_*_sid = string of numbers and characters
phpbb3_*_u = 1

phpbb3_*_u should be the usernumber, which is not 1 in this case but 1261. So, this is the problem. Any idea what might cause this?

Below the settings in the httpd-vhosts file and the phbb3 cookie settings:

Httpd-vhosts file

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:/www/d/o/m/domainname/public_html"
ServerName http://www.domainname
ServerAlias domainname

CustomLog "C:/www/d/o/m/domainname/public_html/www.domainname-access_log" combined
ErrorLog "C:/www/d/o/m/domainname/public_html/www.domainname-error_log"

<Directory "C:/www/d/o/m/domainname/public_html">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Cookie settings phpbb3 forum

cookie_domain = .domainname (according to phpbb documentation the dot before domain is needed)
cookie_path = /
cookie_secure = 0
servername = http://www.domainname
Last edited by surehand on 20. July 2011 09:44, edited 1 time in total.
surehand
 
Posts: 4
Joined: 14. July 2011 18:23

Re: Copy of phpbb3-forum not working correctly in virtual ho

Postby JonB » 18. July 2011 18:14

The most likely problem is with the administrative settings of your forum. I'm not an expert on phpbb2, BUT I am fairly expert on forum software in general, and cookie 'issues' for authentication.

Usually in the admin configuration, there are settings to manipulate how cookies are written. Compare your settings between the two locations.

The best spot to get this answer would be on their forums:
http://www.phpbb.com/community/

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 190 guests