Wordpress Ecommerce website

Wordpress Ecommerce website

Install each component individually

Ref

Setup wordpress and mysql

  1. Download wordpress

  2. Download MySql Community Server and install

  3. Configure MySql

  • Default admin username: root.

  • Open MySql 8.0 Command Line Client

1
2
3
4
5
6
7
8
9
10
11
mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY '86915998cdt';
Query OK, 0 rows affected (0.01 sec)

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
Query OK, 0 rows affected (0.01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

Setup PHP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
;extension_dir = "ext"
// change to
;extension_dir = "D:\tools\php-8.2.0-Win32-vs16-x64\ext"

;extension=openssl
;extension=mysqli
;extension=gd
// uncomment
extension=openssl
extension=mysqli
extension=gd

upload_max_filesize = 2M
post_max_size = 8M
// change to
upload_max_filesize = 128M
post_max_size = 128M

Setup Apache

  • Download
  • Copy wordpress folder into the htdocs folder of nginx.
  • Edit conf/httpd.conf:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Define SRVROOT "/Apache24"
// change to
Define SRVROOT "D:\tools\Apache24"

DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
AllowOverride None
// change to
DocumentRoot "${SRVROOT}/htdocs/wordpress"
<Directory "${SRVROOT}/htdocs/wordpress">
AllowOverride All

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
// change to
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>



#LoadModule rewrite_module modules/mod_rewrite.so
// uncomment
LoadModule rewrite_module modules/mod_rewrite.so

// Add
LoadModule php_module "D:\tools\php-8.2.0-Win32-vs16-x64\php8apache2_4.dll
PHPIniDir "D:\tools\php-8.2.0-Win32-vs16-x64"

#AddHandler cgi-script .cgi
// change to
AddHandler application/x-httpd-php .php

Run and debug

  • Go to localhost:80, the install script runs automatically.
  • If error occurs, debug it:

Edit wp-config.php:

1
2
3
4
5
6
7
define( 'WP_DEBUG', false );
// change to
define( 'WP_DEBUG', true );

define( 'WP_DEBUG_DISPLAY', false );

define( 'WP_DEBUG_LOG', true );

Now there’s a debug.log in wp-content folder.

You may got this in debug.log:

1
Call to undefined function mysql_connect()

It means mysqli extension is not enabled. Run php -m to see all enabled modules.
Or the following php:

1
2
3
4
5
6
7
<pre>
<?php print_r(get_loaded_extensions()); ?>
</pre>

<pre>
<?php phpinfo(); ?>
</pre>

Check out if modules and .ini file are configured correctly.

Install by XAMPP

  1. Download and install

  2. Copy wordpress to D:/xampp/htodcs

  3. Open Mysql Admin, add database and user.

  4. Visit localhost/wordpress and configure wordpress

Configure site

Install theme and plugins

  1. Plugins->Add New, search for woocommerce and install
  • If not able to install online, download the plugin file and install from file.
  1. Others
  • May encounter a dozen of plugins unable to directly install online, download them and install from file.

  • Use Astra theme. May unable to install online, download and install.

  • Use Elementor page builder.

  • Enable gd extension by uncommenting ;extension=gd in PHP.ini

Configure

  1. Settings->Permalinks, set Permalink structure to Post name to enhance SEO.

  2. Enable Astra

  • Appearance->Themes
  • Enable Astra
  • Click theme details and then click Astra Options

Install Importer Plugin

  1. Configure Starter Template for Astra
  • Install Starter Templates plugin and activate it
  • Click See Library
  • Choose Elementor for page builder
  • Select a template and apply
  1. Now customize your website.

Other Important Plugins

  • Yoast SEO: Improve SEO
  • Contact Form 7: Make customer contact you easier
  • UpdraftPlus: Backup website
  • MonsterInsights: Integrates Google Analysis
  • Paypal, Stripe, AliPay: Payment

Maintenance

Backup website

Author

Chendongtian

Posted on

2022-12-20

Updated on

2023-08-04

Licensed under

Comments