Skip to content

ethanpil/wordpress-on-replit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 

Repository files navigation

Run WordPress on Repl.it

Install WordPress and wp-cli on Repl.it using SQLite

How

  1. Create a new Repl.it as a PHP Web Server
  2. Update the replit.nix file to include the code in this repo
  3. Restart the Repl
  4. Run this command from the Replit shell: bash <(curl -s https://raw.githubusercontent.com/ethanpil/wordpress-on-replit/master/install-wordpress-on-replit.sh)

Caveats:

  • WordPress is running on a local SQLite file. Not performant. Great for testing and hacking.
  • WordPress is running on PHP's built in web server which doesn't support rewrites (fancy URLs)
  • Subject to all of the limitations of the SQLite plugin

Future

I would like to explore setting up a Router Script for the PHP web server to see if I can get rewrites working. Some initial research:

Optional PHP Packages

You can install some additional PHP packages with the nix file if your plugins might need them: More details are available from the WordPress Documentation on suggested PHP Extensions.

    pkgs.phpExtensions.curl  
    pkgs.phpExtensions.mbstring   
    pkgs.phpExtensions.imagick
    pkgs.phpExtensions.dom  
    pkgs.phpPackages.exif  
    pkgs.phpPackages.fileinfo  
    pkgs.phpPackages.hash
    pkgs.phpPackages.igbinary
    pkgs.phpPackages.intl

How It Works

Repl.it now allows users to configure a REPL via Nix. The newest Nix environments include packages for PHP with SQLite Support, as well as WP-Cli support. So everything you need is now available. (Unlike in the past when we really had to go deep in and mess with things in a nasty way).

All we have to do now is setup Repl to load in the correct Nix packages and install WordPress with the SQLite plugun. The replit.nix file in this Repo includes the necessary Nix packages and the Bash script install-wordpress-on-replit.sh simply automates the Wordpress install.

The script does the following:

  1. Check to make sure Nix has installed the packages needed for WP-Cli (less and wp).
  2. Download WordPress files through WP-Cli
  3. Download and install the SQLite plugin for WordPress
  4. Create a basic wp-config.php file with some tweaks for Replit and your Repl URL.
  5. Ask for your prefered credentials and install WP

Thanks & Credits

Nix Version:

Original Version:

About

Install WordPress on Repl.it with SQLite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published