Getting 404 errors

Wappler Version: 4.0.0 (Beta 13) … although I don’t think the behavior is any different from 3.9.9 here
For the (local) PHP/ HTML debugger / IDE, I am using IntelliJ IDEA 2021.1.3 (Ultimate Edition) Build #IU-211.7628.21, built on June 30, 2021, with … com.jetbrains.php (211.7628.25), com.kalessil.phpStorm.phpInspectionsEA (
Operating System : macOS 11.4
Server Model: PHP (PHP 8.0.8 (cli) (built: Jul 1 2021 14:19:56) ( NTS ) Copyright © The PHP Group Zend Engine v4.0.8, Copyright © Zend Technologies with Zend OPcache v8.0.8, Copyright ©, by Zend Technologies)
Database Type: None
Hosting Type: AWS EC2 - AMI = LAMP packaged by Bitnami. (Version: 7.3.29-3-r02 on Debian 10)

Expected behavior

The PHP server would find the dmxAppConnect.js and load it.
The PHP server would find the style sheets and apply them.

Actual behavior

You can access a server running the site here (attempting to run the site, anyway):
Link to the broken site.

Errors to the console output when running the site in PHP debugger mode:

  1. Here is a general overview of what is going on, with a few of the errors shown:

  2. Here are images of the error reports from the IntelliJ PHP debugger output:

How to reproduce

These seem to be standard includes when you create a PHP page in Wappler. Nothing special to reproduce this than the above.

Site repository can be found here: Site_Repository_Link

Hi Lukner,
I see in your page you are calling from a CDN for Bootstrap but in the Console it appears as if you are calling it locally? Have you included the extensions you are using in your layout page? Its probably what all the 404’s are about…?

I tried switching App Connect to local (and Bootstrap as well). It made no significant difference (there might be 2-3 errors less). My current “fix” is to remove all the wappler-generated code and use plain php: without wappler code - no errors.

I really don’t understand what should we be looking at on your page? On the link you provided there are no scripts related to any of our components.
Don’t manually edit/cut/remove scripts added by Wappler as it will break your site.

Please provide a link to the page having these issues, so we can check what’s wrong.

Does the debugger start its own local server? The errors is that it can’t find the files (404) or they are served with the wrong mime type, this is a problem with the web server. Do you also get errors in Wappler?

I ran the site on a local Apache system without a problem, i.e. what you have coded works with the exception of the PHP code. It does not show the current date nor does it show the file input form.

At least there are no errors.

As far as the PHP part is concerned, that can be fixed using Wappler components.

Sorry, I need to come back from what I said. In this reply I ran the actual Apache server with this result: (sorry, I added some more PHP code to test)

For some reason, the previous example ran from http://localhost:58279/login.php

1 Like

Ben, this seems like a different issue to me … something with your project definition, paths and site put in a subfolder on the server.

@lukner can you please provide a link which you have not edited and not removed the scripts added by Wappler so we can see what exactly is wrong?

1 Like

Found it! The following two lines are the culprit:

    <meta name="ac:route" content="/login">
    <base href="/">

Thank you very much! You all are amazing!

1 Like

I see the base url is /, which suggests that the site is running in the root. But then I see in Ben’s screenshot the page is run from ralph subfolder. The base url should match the siteroot folder on the server, if not you get the 404 errors because the files are being downloaded from the wrong location. Changing the base to <base href="/ralph/"> should solf the problem in Ben’s case.

I think the problem is that your dev server and remote server do have different base paths, that causes problems. Removing the base tag and the route meta tag will give you problems with routing.

1 Like