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

php verification code error

王林
Release: 2023-02-25 13:50:01
Original
3741 people have browsed it

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文件的权限
Copy after login

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’);
Copy after login

2. Modify php .ini sets the default time zone

date.timezone = PRC
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template