Loading forever 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?

cc @pufferfish101007

perfect-pearls.glitch.me

Is this lamp-poc? Add a random character the glitch.json, wait a minute, the remove it.

The technical explantion is that sometimes Apache conficts with another server. The method above should fix the conflict.

(also, you should be using hello-httpd has a good deal of security issues!)

1 Like

Would hello-httpd fix this problem? What security issues does lamp-poc have?

Hello-httpd wouldn’t fix the loading problem, but:

Lamp-poc has:

hello-httpd fixes these issues.

I’m not really that concerned since it’s a open- source project.

How can I permanently fix the loading issue? When I edited glitch.json earlier, it started working again, but now it’s broken again. What should I do?

Thanks for all your help!

PHP is quite buggy on Glitch as its not supported, but the method above is really the only way to fix it.

You could also trying using just PHP. Remix a static site and add the following to your glitch.json:

{
  "install": "echo 'We Are Ready!'",
  "start": "php -S 0.0.0.0:3000 -t ."
}

You could also try out “PHP in express” however I’m unsure how well this works.

the first does not work since i need .htaccess

how would I implement the second?

I do wanna say a few things:

What do you mean by “You aren’t really supposed to use it for production apps”?

Also, using hello-httpd still won’t fix my main problem. How do other PHP projects load quickly whereas mine doesn’t?

PHP: Built-in web server - Manual.

  1. You are using Glitch, so applications may not be fast as you would like
  2. At most, it took about 700ms (0.7 seconds) to load your website, pretty fast. My website usually loads in about 600ms (0.6 seconds).
  3. Try inlining/serving some assets locally
  4. Try using the webp format for your images. Learn more here
  5. Cache assets assets with service workers
  1. So what I’m doing now with lamp-poc is fine?
  2. I’m afraid you misunderstood me. Every few hours of no website traffic, my website shows the “waking up” page but won’t ever “wake up”.@RiversideRocks said that making an edit to glitch.json will fix that temporally. But after a few more hours, the issue’s back. How can I fix this permanently and how do other PHP projects hosted on glitch handle this?

Sorry for all the confusing, but Glitch doesn’t support PHP officially and these are currently the only workarounds. I’m planning on making a feature request for official PHP soon.

2 Likes
  1. Yes and no. Try going JAMstack using 11ty and webpages will be even faster!
  2. Looks like I did, my bad. Yeah, lanp-poc likes to do this, you can boot your project to prevent this from happening.

Didn’t glitch make lamp-poc?

Is that the ONLY way? There’s no other way to reliably host my site? That really degrades my opinion of glitch.

No, PHP isn’t natively supported on Glitch, I’m just giving you a temporary fix. 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.

1 Like

Bottom line is @RedGuy12 this is the best PHP experience you can get on Glitch right now because PHP isn’t supported. I’m going to make a feature request for official PHP support later and I would love if you voted on it.

2 Likes

Ok but the PHP is working fine. My problem is the forever-loading that sometimes pops up.

Exactly, 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.

But how is that related to php?