tpg icon indicating copy to clipboard operation
tpg copied to clipboard

Can't run locally

Open TheOneAndOnlyGarcia opened this issue 4 years ago • 8 comments

Hello, after "php -S localhost:1234 router.php" I get the following error message from the browser:

JS loading error: file /Users/andrea/Downloads/tpg-master/array-formula-parser-prover-modelfinder-sentree-painter-index.js not found

js is activated, mamp is configured and running, php is installed and running succesfully

TheOneAndOnlyGarcia avatar Mar 11 '20 21:03 TheOneAndOnlyGarcia

Have you entered localhost:1234 as the URL in your browser?

wo avatar Mar 12 '20 10:03 wo

yes I did, will check it tomorrow on my office computer, just to be sure the error is not caused by my local computer.

TheOneAndOnlyGarcia avatar Mar 12 '20 15:03 TheOneAndOnlyGarcia

I'm also getting the same issue after navigating to localhost:1234.

03Farhan avatar Mar 26 '21 12:03 03Farhan

Hey. Thank you for your fantastic work!!! I like to study your program. But I'm also getting the same error massage after navigating to localhost:1234. In index.php this seems causing the trouble, but i cannot fix it..:

<script>
function log(str, tracelog) {
     if (!self.debugWin) debugPopup();
     <?php if ($_GET['debug'] == "trace") { ?>
     if (tracelog) {
         debugWin.document.write("<pre>"+str+"</pre>");
     }
     <?php } else { ?>
     if (!tracelog) {
         debugWin.document.write("<pre>"+str+"</pre>");
     }
     <?php } ?>
}
function debugPopup() {
    self.debugWin = self.open("about:blank","debugWin");
    if (!self.debugWin) alert("unblock popups!");
}
log("hello, this is the debugging window");
</script>
<?php
foreach ($scripts as $script) {
    if (strpos($_GET['debug'], $script) !== false || in_array($_GET['debug'], array("1", "trace"))) {
        print "<script type='text/javascript' src='$script.debug.js'></script>\n";
    }
    else {
        print "<script type='text/javascript' src='$script.js'></script>\n";
    }
}

} else { $allscripts = implode("-", $scripts); print "\n"; } ?>

t0s0 avatar Jul 13 '24 18:07 t0s0

I'm afraid I can't offer much help with setting up php, and I only run Linux myself. But I take the point that I should perhaps remove the php dependency.

You can always save the page from your browser. This should give you a fully functioning local version that doesn't require php.

wo avatar Jul 14 '24 05:07 wo

I've just updated index.php so that it should work even if php is not installed (or not working). To run the page without php, you can rename index.php to index.html and simply open it with your browser.

wo avatar Jul 14 '24 10:07 wo

Yes. It works!!!!! Thank you for fixing! Now I am happy!!!!!

t0s0 avatar Aug 19 '24 18:08 t0s0

I tested it now. Both works - with index.php (debugging working too) and with index.html. Well done!

t0s0 avatar Aug 20 '24 12:08 t0s0