Home  >  Article  >  Backend Development  >  PHP system verification code error

PHP system verification code error

王林
王林Original
2019-09-17 13:04:002939browse

PHP system verification code error

Cause analysis:

1. Session problem

The verification code is not remembered in the session
This should be a permission issue with the session folder of php.

How to handle it:

php-fpm mode
Modify the startup user of php-fpm
session folder is /var/lib/php/session

vi /etc/php-fpm.d/www.conf
Change the user and user group to apache
user =apache
group =apache
Or modify the permissions of the session file according to the user of php-fpm

2. Time zone setting problem

php did not set the correct time zone, resulting in an exception in time judgment

Processing method:

a. Add in the php code Time zone setting

date_default_timezone_set(‘PRC’);

b. Modify php.ini to set the default time zone

date.timezone = PRC

Recommended tutorial: PHP video tutorial

The above is the detailed content of PHP system 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
Previous article:php cannot write to fileNext article:php cannot write to file