Skip to content
Sign upLog in
← Back to Community

Apache Server on Repl.it!

Profile icon
programmeruser

SVG images are not supported

I've gotten the Apache Server to work successfully on repl.it. (PHP doesn't work currently, for some strange reason it can't find the apache php package.)
Edit: PHP now works!
Edit 3/22/2022: there might be a better solution with Nix, but I haven't got it to work yet (idk how services with Nix work)

Voters
Profile icon
thomaslqv
Profile icon
Tycho112
Profile icon
1070041
Profile icon
DexterBanawon
Profile icon
lu700
Profile icon
GarrySmith1
Profile icon
UnknownLITE
Profile icon
ABOS2020
Profile icon
Polo1245Ofi
Profile icon
Baconman321
Comments
hotnewtop
Profile icon
JohnKeyser

Thank you for sharing your interest in the community! I've been struggling with the same issue - my Apache server isn't working on repl it and also click for more to check PapersOwl review there. Would you be willing to answer a few questions about why you're interested in joining and what kind of members we hope to have here?

Profile icon
azlancoding

Hello, I'm having problems with your repl i forked and is pleading for help.
https://replit.com/@azlancoding/php-test-1
It keeps getting stuck on Rewrite package-config files when I run the code.
Any help is appreciated!

Profile icon
azlancoding

@azlancoding
It worked for the first time but then kept failing after that

Profile icon
GarrySmith1

Thanks !

Profile icon
programmeruser

@GarrySmith1
you might want to consider making a better version with the new Nix package manager that was added to Replit since this uses old, hacky methods that aren't really the best (though I haven't tried using Nix for this yet).

Profile icon
xNotKing

@programmeruser
you should make this with nix, and please, can you tell me how can I add extensions like PDO ?

Profile icon
programmeruser

@xNotKing
procrastination rip
anyways remind me soon with a comment to do the nix version
for the extensions you should be able to install a package or something with install-pkg
but you might have to do a lot of filesystem hacks to make it work
that's why I recommend using nix
also I haven't used replit in a long time so it might take a bit longer for the nix version

Profile icon
ABOS2020

I have completely copied the Apache2 folder files onto my project and when I run "bash apache2/start-apache.sh" in shell it works, but here is where the problem exists. The apache thing works for about 5 minutes before it randomly turns off and so to use it again I have to rerun "bash apache2/start-apache.sh." I am no coding expert but your help may save me a lot.

Profile icon
programmeruser

@ABOS2020
what's in the logs?

Profile icon
ABOS2020

@programmeruser
apache.log (it is copied from here) or what console shells when I run "bash apache2/start-apache.sh" command?

Profile icon
programmeruser

@ABOS2020
apache.log

Profile icon
ABOS2020

@programmeruser
I don't think anything changed as all I did was copy the files from this repl. BTW I am using html to code, if you believe that might be the problem.

Profile icon
UCYT5040

How do I specify the path the server should run in? I have a folder called public, can I just run it in there? I don't want other files seen.

Profile icon
programmeruser

@UCYT5040
change $APACHE_DOCUMENT_ROOT

Profile icon
UCYT5040
Profile icon
programmeruser

@Baconman321
PHP now works.

Profile icon
Baconman321

@programmeruser
Oh, cool!

Profile icon
Baconman321

@programmeruser
It's a shame that people don't care about PHP :(

Profile icon
Battledash2

PHP has potential but everyone is saying that it's either outdated or bad which makes new developers not like it.. It's just all the bad developers giving bad influence on new developers..

@Baconman321

Profile icon
Baconman321

@Battledash2
Yeah.

Personally though, without some other server management service, PHP is kinda bad. I mean, sure it's simple and all, but it needs a server to work with because it is bad at handling redirects and such; Apache is much better with that.

Profile icon
Battledash2

Yeah.. PHP + Apache is good.. But... I'd rather use Node anytime tbh.. PHP is good though, I've made a few websites with it. It was easy to use and straight forward. I'd rather use NodeJS just because I'm more used to it, not because PHP is bad (it's not bad)

@Baconman321

Profile icon
Baconman321

@Battledash2
Yeah. In fact, it's a good idea to know it since so many hosting services might offer PHP as a main language (that said, it doesn't meant that you shouldn't learn another language).

Profile icon
Battledash2