Skip to content
← Back to Community
Installing WordPress on Repl.it
Profile icon
ThePPK

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

Creating working directory

mkdir Work cd Work

Downloading all required files

wget http://archive.ubuntu.com/ubuntu/pool/main/p/php7.2/php7.2-mysql_7.2.3-1ubuntu1_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/main/p/php7.2/php7.2-sqlite3_7.2.3-1ubuntu1_amd64.deb wget https://wordpress.org/latest.zip

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

wget https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip

Unpacking WordPress and PHP libraries

for Module in $( ls php*.deb ) do dpkg -x $Module . done unzip -d ../ latest.zip

Moving files to good directories

mkdir ../PHPModules/ # Made for PHP libraries cp usr/lib/php/*/* ../PHPModules/
If you are decided to use SQLite download, unpack and install extension
wget https://downloads.wordpress.org/plugin/sqlite-integration.1.8.1.zip unzip sqlite-integration.1.8.1.zip cp sqlite-integration/db.php ../wordpress/wp-content/ mv sqlite-integration/ ../wordpress/wp-content/plugins/

Creating php.ini file with extensions

cd ../ # Changing work dir mv PHPModules/mysqlnd.so PHPModules/A-mysqlnd.so # Only for change sequence (mysqlnd.so should be loaded before mysqli.so) echo 'extension=pdo.so' > php.ini for Module in $( ls PHPModules/* ) do echo "extension=$Module" >> php.ini done

Creating Replit startup file

echo 'run = "php -c php.ini -S 0.0.0.0:8000 -t wordpress/"' > .replit

Removing all unused files

rm -R Work

Summary

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

Voters
Profile icon
duydog
Profile icon
ditme
Profile icon
ErnestsPakalns
Profile icon
tppParmon
Profile icon
Circleksunkus14
Profile icon
craftalvi
Profile icon
BixardGames
Profile icon
Lienkaiyu
Profile icon
akostyanika
Profile icon
ThePPK
Comments
hotnewtop
Profile icon
YodaCode

I made it even easier to do it:

wget https://wordpress.yodacode.repl.co/download.sh; chmod +x download.sh; ./download.sh

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

Profile icon
ThePPK

@YodaCode Great work )))

Profile icon
YodaCode

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

Profile icon
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

Profile icon
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:

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';

but make sure it's before

/* That's all, stop editing! Happy publishing. */ /** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' ); } /** Sets up WordPress vars and included files. */ require_once ABSPATH . 'wp-settings.php';
Profile icon
shinchanOP1

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

Profile icon
shinchanOP1

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

Profile icon
ThePPK

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

Profile icon
shinchanOP1

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

Profile icon
ThePPK

@shinchanOP1 Can you show log of error?

Profile icon
shinchanOP1

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

Profile icon
ThePPK

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

Profile icon
shinchanOP1

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

Profile icon
YodaCode

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

Profile icon
emeralddd

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

Profile icon
RunTheAlt
Profile icon
YodaCode

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

Profile icon
RunTheAlt

@YodaCode how can I do that

Profile icon
drexelhub

I haven't worked with Replit, but I have a good understanding of WordPress. I think they were able to tell you as much as possible here. If you still have any questions, you can contact https://prosvit.design/wordpress-services/, and they will help you. I built my website through WordPress, and it's an excellent way to create a platform for your business quickly. I created a raw, unattractive food delivery site at the time. It was only through the professional work of web designers that I was able to start making money from my idea.

Profile icon
furrygalaxy

What do i put in the database username and password?

Profile icon
ThePPK

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

Profile icon
furrygalaxy

@ThePolishPPK how about the database host?

Profile icon
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'.

Profile icon
furrygalaxy

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

Profile icon
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.

Profile icon
furrygalaxy

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

Profile icon
furrygalaxy

@ThePolishPPK nvm it only seems to break at mobile.

Profile icon
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.

Profile icon
furrygalaxy

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

Profile icon
ethanpil

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

Profile icon
ThePPK

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

Profile icon
StudioHawaii

thanks

Profile icon
yamilyrealty

How to update PHP to the latest version?

Profile icon
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.

Profile icon
yamilyrealty

@ThePPK - Thank you for the information.

Profile icon
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.

Profile icon
Alxtra

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

Profile icon
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

Profile icon
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

Profile icon
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

Profile icon
matjung

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

Profile icon
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.

Profile icon
ethanpil

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

Profile icon
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

Profile icon
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!

Profile icon
RunTheAlt

@ethanpil Same problem Anything new?

Profile icon
Codemonkey51

Cool!