How to solve Warning: session_start(): Cannot send session cache limiter in WordPress?

How to resolve the WordPress error "Warning: session_start(): Cannot send session cache limiter"?

When Chen Weiliang was testing a WP theme on his local computer, he encountered the following PHP warning:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\wp\ceshimuban\wp-content\plugins\wordpress-seo\frontend\class-json-ld.php:121) in D:\xampp\htdocs\wp\ceshimuban\wp-content\plugins\ad-inserter\class.php(360) : eval()'d code on line 14

translation problem

警告:session_start():无法发送会话缓存限制器 - 已发送的头文件(输出开始于D:\ xampp \ htdocs \ wp \ ceshimuban \ wp-content \ plugins \ wordpress-seo \ frontend \ class-json-ld.php: (360):eval()在第14行的d代码(第121行)在D:\ xampp \ htdocs \ wp \ ceshimuban \ wp-content \ plugins \ ad-inserter \ class.php

Solution

Some people say that becausesession_start(); statement, other html code exists, but

But some people say that his session_start(); It has been done before.

Some people say that it is not good to set the save path of the session, and it is necessary to modify the php.ini file:session.save_path = "C:/phpsession"

(The path behind is set by yourself, and make sure it exists)

  • The php.ini file should generally be located under the system disk/Windows directory

LinuxCommand to query PHP configuration file path

The Linux command queries the storage location of the PHP configuration file php.ini file.

Execute under the shell:

php -v / -name php.ini

Or

find / -name php.ini

The following is the final solution Chen Weiliang found after testing.

  • Modify the php.ini file of the Linux server: session.auto_start = 0 for session.auto_start = 1

Comment

Your email address will not be published. Required fields are marked with * .

Scroll to Top