Help fixing file loading issue on localhost

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
Mannix_
Registered User
Posts: 961
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt
Contact:

Help fixing file loading issue on localhost

Post by Mannix_ »

So I followed this guide https://themanish.com/run-multiple-vers ... ple-xampp/ So I can run different php version per directory and it was successful but I encountered into a problem. When i access said directory the css/js etc are not loading and console display this error.

Code: Select all

Failed to load resource: the server responded with a status of 404 (Not Found)
For some reason the board looks for the files in

Code: Select all

http://localhost/styles/prosilver/theme/responsive.css?assets_version=4
etc. and the files are at

Code: Select all

http://localhost/quickinstall/boards/board31/styles/prosilver/assets/javascript/jquery.min.js?assets_version=4
Is there some kind of redirect I can apply so the file would load?
User avatar
EA117
Registered User
Posts: 1858
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Help fixing file loading issue on localhost

Post by EA117 »

Is it truly only happening when invoking "the other PHP version" that was added? Meaning if you remove the SetHandler & Action override block for what should get invoked for .PHP files -- such that the version of PHP that shipped with XAMPP is used instead -- the issue no longer occurs?

phpBB is normally rendering those asset links based on what it believes the board URL is from the inbound $REQUEST being handled. Is there maybe already a redirect in the .htaccess for that project, which re-writing the original request in some way that assumes he's on the production site rather than your XAMPP? Or is the "Force server URL settings:" enabled in the phpBB ACP for this instance, such that "script path is root" is being imposed for this case where it's not true?

In either of those cases, meaning that this issue is going to happen "whether you had attempted to override the PHP version or not."

If it's actually something unique to the PHP configuration set for the alternate PHP version, I'm a poor resource for what PHP configuration option could have influenced that decision. i.e. What PHP.INI configuration could have directly or indirectly led to a false conclusion "this phpBB board is running at the root." So hopefully someone else might have an idea on that.
User avatar
Mannix_
Registered User
Posts: 961
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt
Contact:

Re: Help fixing file loading issue on localhost

Post by Mannix_ »

EA117 wrote:
Thu Nov 19, 2020 5:22 pm
Is it truly only happening when invoking "the other PHP version" that was added? Meaning if you remove the SetHandler & Action override block for what should get invoked for .PHP files -- such that the version of PHP that shipped with XAMPP is used instead -- the issue no longer occurs?
Yes that is correct.
EA117 wrote:
Thu Nov 19, 2020 5:22 pm
phpBB is normally rendering those asset links based on what it believes the board URL is from the inbound $REQUEST being handled. Is there maybe already a redirect in the .htaccess for that project, which re-writing the original request in some way that assumes he's on the production site rather than your XAMPP? Or is the "Force server URL settings:" enabled in the phpBB ACP for this instance, such that "script path is root" is being imposed for this case where it's not true?
The installation is standard meaning there are no changes done to the .htaccess file also the Force server URL setting is off.
Thank you for your input EA :D
User avatar
EA117
Registered User
Posts: 1858
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Help fixing file loading issue on localhost

Post by EA117 »

Understood. It may already be what you're doing, but if it was happening in my local XAMPP, the next step would be exposing what /includes/functions.php's page_header() had determined for ROOT_PATH versus BOARD_URL ($web_path versus $board_url). In order to try and conclude whether generate_board_url() is determining a wrong board base URL in the first place (i.e. what was determined based on the $request global), versus whether it's only /phpbb/path_helper.php's get_web_root_path() making some miscalculation of "where is the board base path relative to the URL used to access the current page?"

For the style assets to be expected at the path you indicated, ultimately we're saying it's ROOT_PATH / $web_path that "is definitely wrong." But if BOARD_URL / $board_url was already wrong, the style path calculation may just be a secondary symptom. If BOARD_URL / $board_url is correct though, then you can start focusing more closely at where get_web_root_path()'s decision making goes wrong, and how the PHP configuration or version could affect that.

I've never paid attention to whether any lower-edge compatibility limits existed for frameworks like /vendor/symfony/ regarding PHP version. I notice the current version indicates "PHP 7.2.5 or higher", but that's not likely to be the Symfony version actually in play here. Still, to help out someone else besides you or I who actually knows what they're talking about, maybe specify exactly which phpBB version is involved (to imply the Symfony version), as well as exactly which PHP versions are involved in the "working" versus "not working" observations.

Or maybe there is a different way to answer that question: Is this a phpBB version for which you've been successfully running the exact same alternate PHP version in it's own separate installation of XAMPP? But that same PHP version and phpBB version is what's failing now after trying to make a multiple-PHP-version instance of XAMPP? The other possibility this might open up could be to compare the PHP.INI and maybe the Apache .CONFs from the single-PHP-version instance of XAMPP against the configuration you have now based on following the blog post.
Post Reply

Return to “phpBB Custom Coding”