How to use WordPress e-commerce plugins and themes

Source: Internet
Author: User
Tags autoload php debug wordpress database

Prerequisite steps: Uninstall wordpress clean, you need to delete the corresponding database: Drop Databade * *;

(1) First change the permissions of important files in WordPress: 777

(2) After adding the WWW user with usradd-d www/html command, the user is given Wordpress:chown-r/html:www *

(3) You can install the appropriate plugin and upload the theme (no FTP)

1.woocommerce plug-in usage:

(1) Shop page, shop and product page, display, products, settings-products can be displayed in the main part of the page;

(2) to run the Setup Wizard before it can be displayed: Home,cart,checkout,mycount options;

(3) When uploading the theme, the file is larger and needs to be changed:/etc/php.ini file, upload.fize size: 20M

(4) A database connection error occurs frequently, "error establishing a database connection", which means that there is an error connecting data:

* * Always need to restart the virtual host to solve, and now seek a long-term solution:

* * Found not httpd service problem, should be the problem of the MySQL service, because after restarting the HTTPD service, the error persists, but after restarting the MySQL service error resolution, so the judge is MySQL running in WordPress, I disconnected, So find solutions on the internet to solve MySQL's own disconnection at times:

1, MySQL port is occupied,

Reason analysis: 1, previously safe MySQL did not uninstall clean

2, other programs occupy 3306 ports

Change the MySQL configuration file to the port.

3. mysql Connection number problem

Modify the maximum number of connections for MySQL and modify the maximum number of connections for MySQL using the memory variable modification method

(1) Modify the maximum number of MySQL connections (reproduced) using memory variable modification method

The steps are as follows (for both Windows and Linux platforms):

A, client login mysql, enter user name and password

B. Set the new maximum number of connections at the MySQL command prompt to 500:mysql> set GLOBAL max_connections=500

C, display the currently running query:mysql> show processlist

D. Show current mysql system parameter status:mysql> show status

E. Exit Client:mysql> Exit

To see the current maximum number of connections, you only need to do this by executing the following command in the directory where Mysqladmin is located: Mysqladmin-username-password variables |find "Max_con". You can also use the MySQL parameter list in phpMyAdmin to see the maximum number of connections.

Cons: Restarting the computer or MySQL after the maximum number of connections will be reset to the initial value, need to reset.

(2) Other programs:

Open the My.ini file to find the set-variable =max_connections=100 line, change to the maximum number of connections that need to be set, and then restart.

# # #Linux控制台下:

Open my.cnf File: vi/etc/my.cnf

Modify the value of max_connections in the [Mysqld] segment to set the value.

In the [Mysqld] field, add or remove comments

Max_connections = #增加mysql连接数
Wait_timeout = Ten #断开超过10秒的连接

(3) Other reasons and solutions:

1, unable to connect to the database used by WordPress.

The database user name and password in your wp-config.php is wrong, or your database is located on the server that is hanging out! It is also possible that the service provider is limited for a short period of time (a blog with a sudden spike in traffic or a WP plugin that consumes database connections).

The workaround is to confirm that the user name and password information in the wp-config.php is correct. Confirm that the database server used by WP is not hung (can ping or restart directly?!) )。 Confirm the database connection, whether it is a remote connection or a local connection, some of the configuration of remote connections may not connect to the database, it will appear this "Error establishing a Connection", the use of the local connection (localhost).

2, if the server database is just upgraded to MySQL more than 5.0, before the WP blog is normally accessible.

This may be due to MySQL 5.0 with a new password authentication mechanism, which requires the client version to be more than 4.0 (MySQL client in PHP can see PHPINFO), connect the database with the old password mechanism, this will appear "client does not Support authentication protocol requested by server "error prompt, WordPress prompts" error establishing a database connection (may password Error) ".

Workaround:

Method 1, create a new control account for the WordPress database in MySQL, and then modify the database user name and password configuration information in the wp-config.php. Convenient and simple!!

Method 2, under MySQL:

Mysql> SET PASSWORD for
' clin003 ' @ ' clin003.com ' = Old_password (' newpwd ');
mysql> FLUSH privileges;
The clin003 here is replaced with the user name of the WordPress database, clin003.com replaced with localhost or a domain name, newpwd is the user's corresponding password.

Another thing is, look at Phpinfo (), find the path of Mysql_socket display Mysql.sock, confirm that Mysql.sock is indeed under this path, otherwise you need to make a symbolic link. For example, Phpinfo shows that the Mysql_socket path is/var/lib/mysql/mysql.sock, but is actually located in/tmp/mysql.sock, and can be entered at the command line:

Ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock

3, the MySQL service is improperly set up, resulting in the number of MySQL connections exceeding the limit, or the application design problems, resulting in a large number of dormant connections can not be released in time.

Workaround:
Log in to MySQL server

Mysql-u root-p

Using commands

Show Processlist;

View the current number of connections.
If there are too many processes, or there are a large number of timeouts in the Sleep Sleep connection, edit/etc/mysql/my.cnf

Vim/etc/mysql/my.cnf

In the [Mysqld] field, add or remove comments

Max_connections = #增加mysql连接数
Wait_timeout = Ten #断开超过10秒的连接

4, is wp_options database table error, I put the entire database table fixed and optimized a

Table prefixes in wp_options WP according to their actual situation to view!

When WordPress errors occur, debug parameters can be debugged via debug:

Troubleshooting ************ based on wp-config.php debug function

1, in the wp-config.php has a debug parameter, open this parameter, modified to:

Define (' Wp_debug ', ' true ');

2, according to the error prompt to solve the problem, such as the following errors:

WordPress Database error: [Table './clin003_com/wp_options ' is marked as crashed and should be repaired]
SELECT autoload from wp_options WHERE option_name = ' _transient_doing_cron '

WordPress Database error: [Table './clin003_com/wp_options ' is marked as crashed and should be repaired]
SELECT autoload from wp_options WHERE option_name = ' _transient_timeout_doing_cron '

WordPress Database error: [Table './clin003_com/wp_options ' is marked as crashed and should be repaired]
SELECT option_value from wp_options WHERE option_name = ' _transient_doing_cron ' LIMIT 1

The Wp_options table is broken and needs to be repaired using the MySQL client.
Go to MySQL using repaired command repair:

Mysql>repair table wp_options;
It can also be repaired by phpMyAdmin.

3, solve the problem, turn off DEBUG.

Troubleshooting MySQL log records

Log logs in MySQL file

mysql/data/

Inside found a. Err end-file, open. I saw a row.

'. \clin003_com\wp_options ' is marked as crashed and should be repaired
'. \clin003_com\wp_options ' is marked as crashed and should be repaired
'. \clin003_com\wp_options ' is marked as crashed and should be repaired

Fix the method reference above!

WordPress Error Manual 2016/12/14:

Warning : mysql_connect () function: the header and client library minor versions do not match. head: 50547 Library: 50634 on /var/www/html/wordpress/wp-includes/wp-db.php 1559

Workaround:

Always appear that database problem, as if it is Apache load problem, I still change the Nginx server bar **********************

1. Installation: Yum install Nginx
2. Start: cd/usr/sbin/
./nginx

3. Startup success:

4. Download the installation Php-fpm:yum install PHP-FPM

5. Start php-fpm:cd/usr/sbin/

./php-fpm

6. Configure PHP-FPM and Nginx:

Possible solutions, effective ************************

Cause: The current database user does not have all the permissions to operate the Zuker database

It should be given full privileges:

The problem does not seem to be resolved: A database connection error occurred at one time:

1. When this problem occurs, remote with mysql-u root-p password, unable to log into the database

Display Error:

ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)

2. You can rule out the error of Wp.config; Now you should focus on the MySQL server error:

How to use WordPress e-commerce plugins and themes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.