Home >Backend Development >PHP Problem >php verification code error

php verification code error

王林
王林Original
2019-09-28 17:59:083768browse

php verification code error

Problem:

After the new server is configured, the php website is deployed. The website opens and displays normally, but when the user logs in, it always fails. It says the verification code is wrong. (Correct verification code entered)

Cause analysis

1. Session problem

The verification is not remembered in the session code, this should be a permission issue with the session folder of PHP.

Handling method:

php-fpm模式的
修改 php-fpm的启动用户
session 文件夹是 /var/lib/php/session
vi /etc/php-fpm.d/www.conf
将用户改为和用户组改为 apache
user =apache
group =apache
或者将根据php-fpm的用户修改session文件的权限

2. Time zone setting problem

php does not set the correct time zone, resulting in There is an abnormality in time judgment.

Processing method:

1. Add time zone setting in php code

date_default_timezone_set(‘PRC’);

2. Modify php .ini sets the default time zone

date.timezone = PRC

Recommended tutorial:PHP video tutorial

The above is the detailed content of php verification code error. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn