RedGuy12 / perfect-pearls

http://perfect-pearls.glitch.me/
Creative Commons Zero v1.0 Universal
0 stars 1 forks source link

Loading forever problem #11

Open RedGuy12 opened 3 years ago

RedGuy12 commented 3 years ago

Problem

Last night, 8 hours ago, my project was working fine. But now, it’s just saying “waking up” without actually ever “waking up”! This happens pretty often to me. How can I fix this? It says, “starting” for a second, then “waking up” Up until then, my favicon was showing up. Then it reloads and my favicon disappears. It says “starting” for a few seconds again, then changes to “waking up” again and never changes again. How can I permanently fix the loading issue? When I edited glitch.json earlier, it started working again, but now it’s broken again.

Fixes

// We're assuming your express app variable is called 'app'

// Apply PHP manager app.engine('php', phpExpress.engine); app.set('view engine', 'php'); app.all(/.+.php$/, phpExpress.router);


- Yeah, lamp-poc likes to do this; you can boost your project to prevent this from happening.
- Node.js, Python, Flask, and static sites work wonders as many hosting devices have dropped PHP support due to some scripts only working with servers with fast CGI and some that don’t use it, etc. Your site does not need PHP to function correctly. Express + ejs a decent alternative as you have a bit more control over your site.

### Causes
- Sometimes Apache conflicts with another server.
- Sorry for all the confusion, but Glitch doesn’t support PHP officially and these are currently the only workarounds.
- Bottom line is this is the best PHP experience you can get on Glitch right now because PHP isn’t supported.
- I don’t think Glitch is going to fix that unless PHP becomes official. [A staff member recently said that they don’t have plans to update PHP.](https://support.glitch.com/t/node-js-v14-support-when/33576/12)
- There is a PID conflict with httpd. I’ll assume restarting changes the PID.

https://support.glitch.com/t/loading-forever-problem

UPDATE:
Partially fixed, yay!!

This is caused when the page is open for a suspended period at a time. I solved this by making the page redirect when focus is removed from the page. It redirects to a page hosted on GitHub Pages (because I only used Glitch for the PHP). See the code on the gh-pages branch of this repository. When the focus is returned to the page, it redirects back to the page the user was on before.

- [x] Dosen't freeze up
- [x] Redirects to the right page
- [x] Scroll position stays the same
- [ ] URL Parameters stay the same
- [ ] `<input>`, `<textarea>`, and `<select>` values stay the same
RedGuy12 commented 3 years ago

Partially fixed, yay!!

This is caused when the page is open for a suspended period at a time. I solved this by making the page redirect when focus is removed from the page. It redirects to a page hosted on GitHub Pages (because I only used Glitch for the PHP). See the code on the gh-pages branch of this repository. When the focus is returned to the page, it redirects back to the page the user was on before.