Installing WordPress on Repl.it
h
ThePolishPPK (2)

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 )))

You are viewing a single comment. View All
matjung (0)

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 (13)

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 (0)

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

ThePolishPPK (2)

@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 (2)

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

KoljaL (0)

@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 (2)

@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!