Learn to Code via Tutorials on Repl.it!

← Back to all posts
Installing WordPress on Repl.it
h
ThePPK

WordPress need some php libraries unavalible in repl enviroment. This article show you how to install this libraries.

Creating working directory

Downloading all required files

WordPress need MySQL module to work. If you want use SQLite in your project, download SQLite module for PHP:

Unpacking WordPress and PHP libraries

Moving files to good directories

If you are decided to use SQLite download, unpack and install extension

Creating php.ini file with extensions

Creating Replit startup file

Removing all unused files

Summary

You now have installed all required modules and WordPress.
Now you can start work.
Good Luck )))

Voters
craftalvi
BixardGames
Lienkaiyu
akostyanika
ThePPK
Codemonkey51
awodeay1
Comments
hotnewtop
YodaCode

I made it even easier to do it:

It does all the steps of the tutorial in 1 command, which is easy to use.

ThePPK

@YodaCode Great work )))

YodaCode

@ThePolishPPK Thanks! I even did the thing where it renames the default config.

shinchanOP1

@YodaCode Hello, I dont know why but when I ran the cmd it did not load any css for me
repl - https://VigorousNoisyFonts.shinchanop1.repl.co

YodaCode

@shinchanOP1 Ah yes. It is due to the fact that websites served on HTTPS can't load CSS and other files over HTTP. There's a trick to fix it; add this in your wp-config.php:

but make sure it's before

shinchanOP1

@YodaCode Now the CSS is fixed but whenever I login it says you don't have access to this page

shinchanOP1

@YodaCode Also is there any way I could use external database and not sqlite ?

ThePPK

@shinchanOP1 You need only to skip steps with sql integration. Then you should config database settings in wp-config.php.

shinchanOP1

@ThePolishPPK Ohk & and about the login issue ? It says the error every time I login

ThePPK

@shinchanOP1 Can you show log of error?

shinchanOP1

@ThePolishPPK IS THERE ANY OTHER PACKAGES I NEED TO INSTALL WHILE USING A EXTERNAL MYSQL DATABASE ??

ThePPK

@shinchanOP1 Probably no, all packages required by wordpress are downloaded (mysqli and pdo_mysql). Are you sure installed wordpress without sqlite?

shinchanOP1

Yes I did it without sqlite
this is the error I'm getting- Error establishing a database connection
@ThePolishPPK

YodaCode

@shinchanOP1 My simple command allows you to make a minimal-setup Wordpress instance with SQLite. If you want MySQL, follow the tutorial above.

emeralddd

@YodaCode I have done it and now it said "Sorry, you are not allowed to access this page."

RunTheAlt
YodaCode

@RunTheAlt For WordPress on Replit, you need to store files elsewhere, because Replit doesn't save files when the real isn't open.

RunTheAlt

@YodaCode how can I do that

furrygalaxy

What do i put in the database username and password?

ThePPK

@furrygalaxy If you use Sqlite, can be nothing else username and password )))

furrygalaxy

@ThePolishPPK how about the database host?

ThePPK

@furrygalaxy You don't need that if you use SqlLite. If you want store data on external server you shoud buy a database.
If you use SqlLite set 'Database host' blank or write random letters eg. 'example.com'.

furrygalaxy

@ThePolishPPK so meaning, this is uh.. Weird?Image

ThePPK

@furrygalaxy Ohh, sorry, I never seen that error. Try change name of file wordpress/wp-config-sample.php to wp-config.php that shoud skip database configuration.

furrygalaxy

@ThePolishPPK yeah that works now thank you, but uh.. The website looks like uhh not normal? hhh.furrygalaxy.repl.co

furrygalaxy

@ThePolishPPK nvm it only seems to break at mobile.

ThePPK

@furrygalaxy For me it looks ok.
If you want to use Wordpress not for tests then change your secret keys in wp-config.php file. You can generate those keys.

furrygalaxy

@ThePolishPPK everythings working ok now. Thanks for the help.

ethanpil

I don't think this works anymore. Can you confirm?

ThePPK

@ethanpil Oh, yeah. Now wordpress with sqlite extension require sqlite3 lib. I add it to article and add missing "Work" directory creating.

yamilyrealty

How to update PHP to the latest version?

ThePPK

@yamilyrealty You can not update PHP on replit. You may want to buy VPS or hosting who support the newest PHP.
If you really want to have the latest version of PHP on replit you need to download PHP8 binaries and his dependencies (For example from Debian Sid repository). And then replace running script for local binaries.
I have never done this before on replit, and I can not promise that it will work.

yamilyrealty

@ThePPK - Thank you for the information.

uleonard

I followed this and have my WordPress working. But I am having a different issue.

My WordPress is losing all updates I make (posts, theme customization, etc.) there is only one page I first added which is still available. Other pages, posts are being lost.

I am not sure what's the matter.

Please someone help.

Alxtra

Idk but every few days it resets. This is kinda a big mug lol.

ethanpil

I have updated my script which now performs all of these steps, solves many of the problems listed in the comments here. It also installs wp-cli. Please see https://github.com/ethanpil/wordpress-on-replit

matjung

Thanks a million @ThePolishPPK you did a great job.
I got it to work. Up to a point where
wp-admin/setup-config.php?step=1
asked for Database Connection Details
I copied wordpress/wp-config-sample.php into wordpress/wp-config.php and the DB issue is gone
install.php worked fine

One issue outstanding.
Moving it from http to https mode

YellowBanana

yo can u tell me how did u make it work, i did that guide on github and when i press the run button it says PDO drivers are missing? How do i fix this? @matjung

matjung

@YellowBanana
Don't do the guide on github, do the guide that is written above

ThePPK

@YellowBanana When you install WordPress by GitHub instructions it installs only application whose require PDO driver. On Replit you cannot install a PDO driver, but you don't have access to a fully emulated server. Tutorial above include downloading PDO drivers and including them while running PHP server.

ethanpil

@matjung I have updated my script also fixes the SSL issue. Please see https://github.com/ethanpil/wordpress-on-replit

KoljaL

@ethanpil The install process works but after the login i`m not able to visit "wp-admin": Sorry, you are not allowed to access this page.

After enabling the debug output, i got the notice like here, but after fixig there is still no access to the admin area: https://translate.google.com/translate?hl=de&tl=de&sl=auto&u=https%3A%2F%2Fqooga.jb-jk.net%2Fwp%2Fcorrespondence-of-sqlite-integrations-noties%2F

ethanpil

@KoljaL yes, I see the issue. Its related to the check $current_user = wp_get_current_user(); in wp-includes/capabilities.php. This very temporary fix allows you to login https://stackoverflow.com/a/41881463/933782

But there are definately underlying issues still. Looks like the sqlite3 plugin may not be as compatible as it used to be. I will keep at it in the meantime. Please share if you have any insights!

RunTheAlt

@ethanpil Same problem Anything new?

Codemonkey51

Cool!