Install latest wordpress on Ubuntu 18.04

There is nothing special except PHP. WordPress require php7.3 or higher which is not available in default ubuntu repository. So this post will be mostly how to compile latest version of php. But let’s proceed step-by-step.

  • Install all required components:
    apt-get update
    #general applications
    apt-get install vim pwgen nginx mysql-server certbot
    #required for build
    apt-get install build-essential pkg-config libxml2-dev sqlite3 libsystemd libsystemd-dev libcurl4 libcurl4-openssl-dev libpng-dev libonig-dev libzip-dev
  • Install php:
    mkdir -p ~/temp && cd ~/temp
    wget https://www.php.net/distributions/php-7.4.5.tar.gz
    tar -xzf php-7.4.5.tar.gz && cd php-7.4.5
    ./configure --enable-fpm --with-mysqli --with-fpm-systemd --with-zip --enable-soap --with-xmlrpc --enable-mbstring --enable-intl --with-fpm-systemd --with-curl --enable-gd
    make
    make install
    cp php.ini-production /usr/local/php/php.ini
    cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf
    cp sapi/fpm/php-fpm /usr/local/bin
    cp sapi/fpm/php-fpm.service /etc/systemd/system/php-fpm.service
    systemctl daemon-reload
    systemctl start php-fpm
  • Install wordpress:
    cd /var/www
    wget https://wordpress.org/latest.tar.gz
    tar -xzf latest.tar.gz
  • Configure nginx, fpm and  mysql. Detailed steps you can find in official documentation

 

Useful links:

No comment yet
Leave a Reply

Your email address will not be published. Required fields are marked *