CSS code working online doesn't work in XAMPP

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

CSS code working online doesn't work in XAMPP

Postby J-W43 » 27. January 2016 17:34

XAMPP 7.0.1 Apache 2.4.4 + MySQL 5.5.32
I was given CSS code by phpBB to change the font of a topic title or post subject title for a phpBB3 forum which works perfectly online in IE11 and Firefox on Windows 7 and in IE11 on Windows 8.1.

However, in XAMPP on Windows 7 in both IE11 and Firefox the CSS isn't processed.

The code extracts below show the Inspect element from the online page and from the XAMPP page in Firefox (same in IE11):

Online page in Firefox:

.... element { ....... inline
}
.......... links.css:83
a.topictitle[href$="./viewtopic.php?f=9&t=8"] {
color: #00F;
}
.......... common.css:48
a:link, a:visited {
color: #3F3F3F;
}

with HTML
<a href="./viewtopic.php?f=9&amp;t=8" class="topictitle">EVENT LISTING &amp; DATES 2016</a>

AND IN XAMPP IN FIREFOX::

.... element { ....... inline
}
.......... common.css:66
a:focus, a:hover, a:active {
text-decoration: underline;
color: #BC2A4D;
}
.......... common.css:48
a:link, a:visited {
color: #3F3F3F;
}

with HTML
<a href="./viewtopic.php?f=9&amp;t=8&amp;sid=604477a462f3e1cbd3d80c6688641866" class="topictitle">EVENT LISTING &amp; DATES 2016</a>

NOTE that this html in XAMPP has numbers after the t=8. It appears that XAMPP is processing CSS in a different order and missed out the topictitle code for ?f=9&t=8".

Have you any idea why the CSS isn't being processed? The phpBB code is quite complicated with several CSS files but it is processing the links.css file elsewhere for instance the line 76 below.

There is one place where a different code worked in XAMPP where I used it for a subject line in a post:
.......... links.css:227
#p34 .postbody h3 a {
color: #00F;
}
with HTML code <a href="#P34"> .....
J-W43
 
Posts: 6
Joined: 27. January 2016 16:40
Operating System: Windows 7

Re: CSS code working online doesn't work in XAMPP

Postby Nobbie » 27. January 2016 19:00

J-W43 wrote:NOTE that this html in XAMPP has numbers after the t=8. It appears that XAMPP is processing CSS in a different order and missed out the topictitle code for ?f=9&t=8".


Neither Xampp nor Apache are processing CSS, they even dont know anything about it. CSS is processed and interpreted by the browser only.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: CSS code working online doesn't work in XAMPP

Postby J-W43 » 27. January 2016 19:54

If that is the case, why is the same browser with one window open online and another looking at localhost producing a different result from the same file?

I copied all the files from the online server into XAMPP. I've just checked that they are the same on XAMPP.

I'm beginning to think it must be because of different PHP versions, 5.4 at my host and 7.01 on XAMPP (which is more recent). There is so much PHP in the phpBB forum and so many files perhaps the XAMPP PHP can't deal with it. Maybe something to do with sessions, is that what the code sid=60447..... refers to?

The readme file says I should have Visual C ++ 2008 and I have 2015 version. I don't know whether this is relevant.
J-W43
 
Posts: 6
Joined: 27. January 2016 16:40
Operating System: Windows 7

Re: CSS code working online doesn't work in XAMPP

Postby Nobbie » 27. January 2016 20:55

J-W43 wrote:If that is the case, why is the same browser with one window open online and another looking at localhost producing a different result from the same file?


Either it is NOT the same file (same PHP file does not automatically mean same HTML output and only the HTML output counts), or you may have downloaded the PHP Scripts and databases locally to your PC, but you do not use the online server name locally, but "localhost" instead. This may lead to invalid links in some HTML documents.

J-W43 wrote:I copied all the files from the online server into XAMPP. I've just checked that they are the same on XAMPP.


Exactly what i thought. And did you call your local server exactly the same as your online server? Or did you change anything in phpBB to tell it, that it is running on "localhost" instead of your online server? This is mostly the reason for simply MISSING(!) CSS files, as the scripts usually generates links to the server, which cannot be evaluated on localhost. You definately cannot simply run your online phpBB forum locally without any changes, that does not work anyway.

J-W43 wrote:There is so much PHP in the phpBB forum and so many files perhaps the XAMPP PHP can't deal with it.


Funny. No, its not Xampp, its YOU! You do not have the knowledge how to import and run an online script locally on your PC. You have to adapt either the server environment exactly, or you have to adapt the configuration of phpBB. It is insuffient simply to copy the scripts and the data.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: CSS code working online doesn't work in XAMPP

Postby J-W43 » 27. January 2016 22:35

Thanks for your comments.

I followed the phpBB tutorial to use XAMPP https://www.phpbb.com/support/docs/en/3.0/kb/article/installing-and-setting-up-your-own-web-server/ which uses localhost and I set up a user with the same name and password and called the database the same name and imported the database and copied the files.

The result is almost perfect except for the code I mentioned before.

I'll check again. All the CSS files have been used, except for one code. I have refreshed the page and restarted the computer to see if it made a difference but it didn't. Is there an equivalent of deleting temporary files in XAMPP in case an old version has been saved?
J-W43
 
Posts: 6
Joined: 27. January 2016 16:40
Operating System: Windows 7

Re: CSS code working online doesn't work in XAMPP

Postby Altrea » 27. January 2016 22:55

This tutorial describes how to set up a fresh phpbb installation locally.
It does not describe how to migrate an existing online phpbb to a local server.

So your data/configuration must have something indicating your server environment which does not fit your local server.
Very common this is the url which is configured in a config file or database.

But at the end it is still a phpbb issue not a XAMPP issue.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: CSS code working online doesn't work in XAMPP

Postby Nobbie » 27. January 2016 23:19

J-W43 wrote:and imported the database and copied the files.


... and exacty thats the part, which is not covered by that tutorial and what does not work automatically. You still have to adapt the configuration, as you applied a servername on your ONLINE forum, which does not match your local server (localhost).
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: CSS code working online doesn't work in XAMPP

Postby J-W43 » 28. January 2016 21:29

PhpBB3 support said my config and set up was OK but PHP 7.01 on XAMPP is too high for phpBB3.1 and the css code they recommended won't work.

Since PHP 7 is only used locally for testing on XAMPP and only affects one css code, I'll live with it at the moment. Thanks
J-W43
 
Posts: 6
Joined: 27. January 2016 16:40
Operating System: Windows 7

Re: CSS code working online doesn't work in XAMPP

Postby Nobbie » 28. January 2016 22:01

J-W43 wrote:PhpBB3 support said my config and set up was OK but PHP 7.01 on XAMPP is too high for phpBB3.1 and the css code they recommended won't work.


This is pure nonsense. CSS is not affected by PHP, in no way. Maybe phpBB is not yet tested with PHP 7, but maybe i will do so the next days.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: CSS code working online doesn't work in XAMPP

Postby Altrea » 28. January 2016 23:38

phpBB 3.2 is announced to be php 7 compatible.
But as Nobbie already mentioned it is very unlikely that phpBB uses complex php code to generate css files or dependicies when to deliver them.
There is a base URL in the phpbb configuration which is used to generate asset URLs, that's it.

You can use any browser development panel like Firebug to check if the requested resources cannot be received because of wrong URL
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: CSS code working online doesn't work in XAMPP

Postby J-W43 » 29. January 2016 08:46

I didn't believe phpBB's advice either, but I've found a temporary work-around.

The colour-change css code works online with a.topictitle[href$="f=9&t=8"] {color: #00F;} so I never need to edit that. I don't need the whole path ./viewtopic.php?f=9&t=8 .

The ID in XAMPP is different so I add a duplicate css code with a different ID
a.topictitle[href$="f=9&t=8&sid=766790b23d1f3fb6fca3ed3b502d72b0"] {color: blue;}

which works in XAMPP but unfortunately the sid code changes every time I start XAMPP, but since I only have one or two items and it's only local for my testing I can easily change the code every time I start XAMPP.

Since XAMPP is adding a security identifier sid= to every code, perhaps I need to cancel it, but I don't know where to do it. In PHPMyAdmin I have All Privileges.

I'll continue to look at my set up to see if I can cure the problem permanently.
J-W43
 
Posts: 6
Joined: 27. January 2016 16:40
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 112 guests