WordPress Supports PHP 72 Heres How to Install on Ubuntu with Nginx and MariaDB Support

8 Pages • 1,057 Words • PDF • 251.1 KB
Uploaded at 2021-09-24 07:01

This document was submitted by our user and they confirm that they have the consent to share it. Assuming that you are writer or own the copyright of this document, report to us by using this DMCA report button.


WordPress Supports PHP 7.2 – Here’s How to Install on Ubuntu with Nginx and MariaDB Support websiteforstudents.com/wordpress-supports-php-7-2-heres-how-to-install-with-nginx-and-mariadb-support February 6, 2018

!robot | 02/06/2018 | Labs, Linux Ubuntu, WordPress Labs | WordPress recent maintenance release adds support for PHP 7.2… If you were wondering how to install it on Ubuntu 16.04 LTS / 17.04 / 17.10, the steps below show you how… WordPress, the most powerful and popular content management systems (CMS) is the right tool to develop and build powerful and dynamic websites based on PHP… Although support for PHP 7.2 compatibility is added to this release, some plugins and themes may be yet to support PHP 7.2… so before upgrading PHP, make sure your site won’t break because of it. For students and new users who want to install WordPress with PHP 7.2 support with Nginx and MariaDB, the steps below is a great place to start..

Step 1: Install Nginx HTTP Server To install Nginx on Ubuntu, run the commands below: 1/8

sudo apt update sudo apt install nginx

After installing Nginx, the commands below can be used to stop, start and enable Nginx service to always start up with the server boots. sudo systemctl stop nginx.service sudo systemctl start nginx.service sudo systemctl enable nginx.service

Step 2: Install MariaDB Database Server To install MariaDB, run the commands below. sudo apt-get install mariadb-server mariadb-client

After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots. sudo systemctl stop mariadb.service sudo systemctl start mariadb.service sudo systemctl enable mariadb.service

After that, run the commands below to secure MariaDB server by creating a root password and disallowing remote root access. sudo mysql_secure_installation

When prompted, answer the questions below by following the guide. Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter password Re-enter new password: Repeat password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y Restart MariaDB server sudo systemctl restart mariadb.service

Step 3: Install PHP 7.2-FPM and Related Modules PHP 7.2 isn’t available on Ubuntu default repositories… in order to install it, you will have to get it from third-party repositories. Run the commands below to add the below third party repository to upgrade to PHP 7.2

2/8

sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php

Then update and upgrade to PHP 7.2 sudo apt update sudo apt install php7.2-fpm php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2gd php7.2-xml php7.2-mysql php7.2-cli php7.2-zip php7.2-curl

After install PHP 7.2, run the commands below to open PHP-FPM default file. sudo nano /etc/php/7.2/fpm/php.ini

Then make the changes on the following lines below in the file and save. The value below are great settings to apply in your environments. file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 100M cgi.fix_pathinfo=0 max_execution_time = 360 date.timezone = America/Chicago

Step 4: Create WordPress Database Now that you’ve install all the packages that are required, continue below to start configuring the servers. First run the commands below to create a blank WordPress database. To logon to MariaDB database server, run the commands below. sudo mysql -u root -p

Then create a database called wpdb CREATE DATABASE wpdb;

Create a database user called wpdbuser with new password CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database. GRANT ALL ON wpdb.* TO ' wpdbuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit. FLUSH PRIVILEGES; EXIT;

Step 5: Download WordPress Latest Release 3/8

Next, visit WordPress site and download the latest version…. After downloading, run the commands below to extract the downloaded file and move it into a new WordPress root directory. cd /tmp && wget https://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz sudo mv wordpress /var/www/html/wordpress

Then run the commands below to set the correct permissions for WordPress to function. sudo chown -R www-data:www-data /var/www/html/wordpress/ sudo chmod -R 755 /var/www/html/wordpress/

Step 6: Configure Nginx HTTP Server Finally, configure Nginx site configuration file for WordPress. This file will control how users access WordPress content. Run the commands below to create a new configuration file called wordpress sudo nano /etc/nginx/sites-available/wordpress

Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location. server { listen 80; listen [::]:80; root /var/www/html/wordpress; index index.php index.html index.htm; server_name

example.com www.example.com;

client_max_body_size 100M; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

Save the file and exit.

Step 7: Enable the WordPress and Rewrite Module After configuring the VirtualHost above, enable it by running the commands below… the commands also disable PHP7.0 and enable PHP 7.1 for Nginx. 4/8

sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/

Step 8 : Restart Nginx To load all the settings above, restart Nginx by running the commands below. sudo systemctl restart nginx.service

STEP 9: CONFIGURE WORDPRESS Now that Nginx is configured, run the commands below to create WordPress wpconfig.php file. sudo mv /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wpconfig.php

Then run the commands below to open WordPress configuration file. sudo nano /var/www/html/wordpress/wp-config.php

Enter the highlighted text below that you created for your database and save. // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wpdb'); /** MySQL database username */ define('DB_USER', 'wpdbuser'); /** MySQL database password */ define('DB_PASSWORD', 'user_password_here'); /** MySQL hostname */ define('DB_HOST', 'localhost'); /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', '');

After that, open your browser and browse to your domain name to launch WordPress configuration wizard. You should see WordPress setup wizard to complete. Please follow the wizard carefully.

http://example.com

5/8

Then type the WordPress website name and create a new admin user and password.. the click install.

6/8

This should install WordPress.

7/8

Congratulations! You’ve successfully installed WordPress on Ubuntu. You may also like the post below:

!robot This post was not written by a robot. I spend my spare time searching for ways to help students and new users get to know and understand Linux, Ubuntu, Windows, and Open Source software. ~Enjoy!

8/8
WordPress Supports PHP 72 Heres How to Install on Ubuntu with Nginx and MariaDB Support

Related documents

5 Pages • 735 Words • PDF • 178.9 KB

4 Pages • 1,633 Words • PDF • 316 KB

9 Pages • 2,001 Words • PDF • 1.1 MB

1 Pages • 199 Words • PDF • 38.1 KB

9 Pages • 2,006 Words • PDF • 1 MB

16 Pages • 5,235 Words • PDF • 609.3 KB

538 Pages • 167,272 Words • PDF • 8.5 MB

15 Pages • 796 Words • PDF • 3.2 MB

27 Pages • 11,295 Words • PDF • 3.8 MB