Обнаружена активная php сессия wordpress как исправить ошибку

Ошибки "Обнаружена активная PHP сессия" и "REST API выдал ошибку" В связи с появлением свободного времени, решил Я проверить техническое состояние своего сайта, произвести обновление различных компонентов (Wordpress, PHP, MySQl, Apache и т.д) и проверить работоспособность программного обеспечения. Открыв "Здоровье сайта" если кто не знает это встроенный инструмент для диагностики состояния системы и сервера, я

В связи с появлением свободного времени, решил Я проверить техническое состояние своего сайта, произвести обновление различных компонентов (WordPress, PHP, MySQl, Apache и т.д) и проверить работоспособность программного обеспечения. Открыв «Здоровье сайта» если кто не знает это встроенный инструмент для диагностики состояния системы и сервера, я увидел сообщение о двух критических проблемах «Обнаружена активная PHP сессия» и «REST API выдал ошибку». Когда появились эти ошибки было не понятно, но думаю достаточно давно так как данный инструмент последний раз Я открывал наверно еще в прошлом году. Влияние этих ошибок на работоспособность сайта было совсем не значительное, так как сайт работал в штатном режиме. Но раз проблемы есть да и еще критические их хотелось решить. Поискав информацию в интернете, Я понял что в большинстве случаем причины появления этих ошибка практически одинаковые, и решение одно и тоже. Сегодня хочу поделиться своим случаем.

WordPress как убрать критические проблемы

И так вы обнаружили следующие критические проблемы на своем сайте.

Обнаружена активная PHP сессия

Сессия PHP была создана вызовом функции session_start(). Это препятствует работе REST API и петлевых запросов. Сессия должна быть закрыта функцией session_write_close() перед выполнением любых HTTP-запросов.

REST API выдал ошибку

REST API — один из способов коммуникации WordPress и других приложений с сервером. К примеру, экран редактора блоков использует его для отображения и сохранения ваших записей и страниц.

Запрос к REST API неудачен из-за ошибки.

Ошибка: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_requ

Обнаружена активная PHP сессия

В 99% случаев эти ошибки связаны с установленными плагинами и темами. Что нужно сделать, для начала произвести обновление, если это не поможет то по очереди отключать плагины и проверять состояние, если и это не поможет то нужно переустановить тему. Если тема доработана и переустановка приведет к потери всех изменений то можно просто поменять на стандартную.

Wordpress Здоровье сайта

В моем случае причиной появления ошибок «Обнаружена активная PHP сессия» и «REST API выдал ошибку» стал плагин «Капча».

Wordpress как убрать критические проблемы

После его отключения все критические проблемы пропали.

REST API выдал ошибку

Плагины могут быть причиной и других ошибок и даже замедлять работу сайта. В общем если возникают какие либо проблемы с работоспособностью сайта в первую очередь нужно проверить плагины и установленную тему, это касается в первую очередь WordPress.

Вебмастер онлайн


Приветствую Вас, друзья! Столкнулся с такой проблемой, плагин Yoast SEO выдавал критическую ошибку «Обнаружена активная PHP сессия»:

Сессия PHP была создана вызовом функции session_start(). Это препятствует работе REST API и петлевых запросов. Сессия должна быть закрыта функцией session_write_close() перед выполнением любых HTTP-запросов.

Как-то руки не доходили добраться до этого, ошибка висела, особого внимания не обращал. Решил посмотреть как исправить, заглянул на некоторые сайты и увидел, что такая проблема не только у меня.

Нашёл какие-то рекомендации, заумные посты программистов, но решения не нашёл. Немного повозился, выявил причину и решение как исправить эту беду в моём случае на WordPress.


Критическая ошибка session_start() в WP


Пошаговые действия по исправлению функции session_start() на session_write_close() в WordPress

Сначала надо выявить причину, что влияет на появление ошибки, плагины или шаблон. Первым делом проверить установленные контактные формы путём их отключения, возможно на этом ваши поиски закончатся.

В моём случае начал проверять плагины:

  • Установил плагин «Health Check & Troubleshooting» для выявления неисправности. Он позволяет перейти в «настроечный режим» и отключать все плагины, тему, но при этом сайт будет работать для посетителей в нормальном режиме;
  • Переходите в настроечный режим и смело можно в нём работать, не опасаясь за исправную работу сайта в это время;
  • В результате манипуляций определил причину: Контактная форма «Contact Form by BestWebSoft», при его отключении проблема функции session_start() исчезала;
  • Установил «Contact Form 7», проверил: Проблемка закрыта.

Состояние здоровья сайта


Критическую ошибку с функцией «session_start()» может показывать не только Yoast, но и другой плагин SEO, например, All in One SEO Pack. Во время проверки откройте окно со страницей критической ошибки, по мере включений-выключений плагинов для надёжности обновляйте, чтобы не пропустить виновника.

Как узнать тему и плагины на чужом сайте

Вывод

Конфигурация моего сайта видимо не уживалась с контактной формой «Contact Form by BestWebSoft», возможно у вас будет причина в других установленных или в шаблоне.

Делитесь, какие причины выдавали вам проблему с функцией session_write_close(), удалось ли выявить и исправить проблему. Какими способами?

Плагин от спама в комментариях и контактной форме для WP

Мета теги: Как писать на сайте

Желаю Удачи!

Viewing 15 replies — 1 through 15 (of 19 total)

  • Hi @mikeydev,

    Thanks for letting us know this. It looks like this message is being shown to other plugins since the update to WP version 5.5. I sent a report to the Developers to investigate this case. Also, do you see an error or issue in the interface of Awesome Support?

    Regards.

    I got the same issue and could not submit a support ticket as a customer. No matter which account I logged into (switched to) the form always showed the same fields filled in – it wasn’t a new form. And it wouldn’t save – but would send me to a 404 page. Disabling the plugin removed the issue.

    I too am having the same issue:

    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    Before I place my order for your paid version, I need to know its issue can be resolved.

    ISSUE:

    At first, I reached out to my hosting provider and they told me that the issue stems from Awesome Support Plugin. The following is my host providers message:
    My name is Andrija, and I am working on a “Custom request” for veriseal.pro.
    Per your request, I have checked your website and found out that this site health issue is related directly to the Awesome Support plugin. When deactivated, site health reports no critical issues as you can see here:
    https://prnt.sc/u3dlpp
    I have activated it again, in case you need it, but, if this plugin is not required for your website feel free to deactivate it. Please note that this issue is related to the plugin code itself and it will possibly be solved with some of the new plugin updates.
    If you have more questions regarding this issue you can always contact the plugin support here:
    https://getawesomesupport.com/submit-ticket/
    We were glad to help you find the source of this issue for you, but since we didn’t solve it, I have refunded one credit to your subscription (current state 3/5).

    Also, no error or issue is shown in the interface of Awesome Support.

    I look forward to your reply.

    Thank you,
    Fabio

    Hi,

    Thanks for your information. This issue is under investigation by my team. Also, could you share us the debug.log error messages shown in your sites?

    Regards.

    Not sure where to find the debug.log? I went into my cPanel/wp-content folder but only found a file named debug.log-old The content of this file only contains a log up July 26/2020
    I also searched the rest of the folders but can not find debug.log file.

    After I posted this issue, I was able to submit a ticket regarding this matter.
    Yeison is currently helping me. This is the reply I received:

    Yeison
    August 26, 2020 12:22 am
    Hi Fabio,

    Thanks for reaching us. I created a report so that the developers can look at the information you kindly share us. The fixes applied will be released in an upcoming release.

    Regards.

    Hi,

    While we are working on the fixes, there is a plugin that WordPress launched for compatibility since its update to version 5.5:

    Enable jQuery Migrate Helper

    Please let me know if this works (you might be seen a message on top of your backend, this is expected while using the plugin).

    Regards.

    Hi,

    I installed the jQuery Migrate Helper Plugin and activated it and I still have the same critical issue showing.

    “A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests”.

    I’ll hold on until the fix is made.

    Regards.

    Hello!
    I have the same problem – An Active PHP session was detected
    This error message is appearing on my site in Site Health (WordPress 5.5.1).

    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    Deactivating the plugin removes the error.

    When should we wait for the plugin update?

    Hi lemoncpl,

    They are working on the fixes, the suggested plugin that WordPress launched for compatibility since its update to version 5.5:

    Enable jQuery Migrate Helper

    Did not work for me. I’ve rolled back to version 5.8.2. and I don’t have any issues.
    I just wait until the fix has been rolled out.

    Fab

    Hi @fpuccinelli8,

    Thanks for the additional info, I will send the report to the developers that the Plugin works well in version 5.8.2 but not in 6.0. Also, here is a guide to see the debug.log file:

    – https://wordpress.org/support/article/debugging-in-wordpress/

    @lemoncpl, @rjjacob, @mikeydev, my team is investigating and working for a solution to this issue.

    Regards.

    Hi Yeisonbp,

    Sorry for the delay in my reply. This start of school has taken me away from the development of my site. FYI, I ran into more issues and had to conduct a plugin conflict test. In doing so, it lead me again to your Awesome Support plugin.

    My host provider also confired that Awesome Support plugin is causing issues.

    This is the reply I received from my host provider rep:
    vsutanovac – September 5, 2020, 05:49 a.m.
    Hi Fabio,
    My name is Vladimir WPPS team. Thanks for reaching out.
    The intermittently Error 502 isn’t related to the hosting issues.
    I’ve increased the memory limit by adding the code in wp-config.php define(‘WP_MAX_MEMORY_LIMIT’, ‘1024M’);
    Also, debug mode reported the Awesome Support plugin database issues so I deactivated it.
    Now, I am not able to use your plugin, including version 5.8.2.

    The following is a snipit of the error log:

    0`5-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/functions-templating.php on line 694
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 193
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 220
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/functions-templating.php on line 694
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 242
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 193
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 220
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 242
    [05-Sep-2020 08:49:18 UTC] WordPress database error Table ‘i4767007_wp1.wp_sm_sessions’ doesn’t exist for query SELECT * FROM wp_sm_sessions WHERE session_key = ’71bbaba62dd022719b9dc9dd8ef99ece’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), include_once(‘/plugins/awesome-support/awesome-support.php’), WPAS, Awesome_Support::instance, Awesome_Support->init, WPAS_Session->__construct, WPAS_Session->init, WP_Session::get_instance, WP_Session->__construct, WP_Session->read_data, WP_Session_Utils::get_session, QM_DB->query
    [05-Sep-2020 08:49:18 UTC] WordPress database error Table ‘i4767007_wp1.wp_sm_sessions’ doesn’t exist for query SELECT * FROM wp_sm_sessions WHERE session_key = ‘e4595a750ac8e9892394771ef74a166e’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), include_once(‘/plugins/awesome-support/awesome-support.php’), WPAS, Awesome_Support::instance, Awesome_Support->init, WPAS_Session->__construct, WPAS_Session->init, WP_Session::get_instance, WP_Session->__construct, WP_Session->read_data, WP_Session_Utils::get_session, QM_DB->query`

    For now I have deactivated your plugin. Please let me and other know whe a fix has been made.

    Regards,
    Fabio Puccinelli

    Hi @fpuccinelli8,

    The continue 2 messagges were fixed with the update of the 6.0 update. A new version with bugfixes will be launched soon, so please let us know if this update works.

    Thanks.

    Hi Yeisonbp,

    Thank you for the follow-up and the great news.
    Looking forward to re-activating your plugin and to use your plugin again.

    I’ll keep an eye out for the launch of the new version.

    Fabio

    Hi @fpuccinelli8,

    Please update the plugin. We updated it a few days ago. Let us know if this update fixes your issues.

    Regards.

    Hi Yeisonbp,

    Thank you for the follow-up and the great news.
    I’ve re-activated your plugin and I will need a couple of days to see if all is good.

    Fabio

  • Viewing 15 replies — 1 through 15 (of 19 total)

    Viewing 15 replies — 1 through 15 (of 19 total)

  • Hi @mikeydev,

    Thanks for letting us know this. It looks like this message is being shown to other plugins since the update to WP version 5.5. I sent a report to the Developers to investigate this case. Also, do you see an error or issue in the interface of Awesome Support?

    Regards.

    I got the same issue and could not submit a support ticket as a customer. No matter which account I logged into (switched to) the form always showed the same fields filled in – it wasn’t a new form. And it wouldn’t save – but would send me to a 404 page. Disabling the plugin removed the issue.

    I too am having the same issue:

    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    Before I place my order for your paid version, I need to know its issue can be resolved.

    ISSUE:

    At first, I reached out to my hosting provider and they told me that the issue stems from Awesome Support Plugin. The following is my host providers message:
    My name is Andrija, and I am working on a “Custom request” for veriseal.pro.
    Per your request, I have checked your website and found out that this site health issue is related directly to the Awesome Support plugin. When deactivated, site health reports no critical issues as you can see here:
    https://prnt.sc/u3dlpp
    I have activated it again, in case you need it, but, if this plugin is not required for your website feel free to deactivate it. Please note that this issue is related to the plugin code itself and it will possibly be solved with some of the new plugin updates.
    If you have more questions regarding this issue you can always contact the plugin support here:
    https://getawesomesupport.com/submit-ticket/
    We were glad to help you find the source of this issue for you, but since we didn’t solve it, I have refunded one credit to your subscription (current state 3/5).

    Also, no error or issue is shown in the interface of Awesome Support.

    I look forward to your reply.

    Thank you,
    Fabio

    Hi,

    Thanks for your information. This issue is under investigation by my team. Also, could you share us the debug.log error messages shown in your sites?

    Regards.

    Not sure where to find the debug.log? I went into my cPanel/wp-content folder but only found a file named debug.log-old The content of this file only contains a log up July 26/2020
    I also searched the rest of the folders but can not find debug.log file.

    After I posted this issue, I was able to submit a ticket regarding this matter.
    Yeison is currently helping me. This is the reply I received:

    Yeison
    August 26, 2020 12:22 am
    Hi Fabio,

    Thanks for reaching us. I created a report so that the developers can look at the information you kindly share us. The fixes applied will be released in an upcoming release.

    Regards.

    Hi,

    While we are working on the fixes, there is a plugin that WordPress launched for compatibility since its update to version 5.5:

    Enable jQuery Migrate Helper

    Please let me know if this works (you might be seen a message on top of your backend, this is expected while using the plugin).

    Regards.

    Hi,

    I installed the jQuery Migrate Helper Plugin and activated it and I still have the same critical issue showing.

    “A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests”.

    I’ll hold on until the fix is made.

    Regards.

    Hello!
    I have the same problem – An Active PHP session was detected
    This error message is appearing on my site in Site Health (WordPress 5.5.1).

    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    Deactivating the plugin removes the error.

    When should we wait for the plugin update?

    Hi lemoncpl,

    They are working on the fixes, the suggested plugin that WordPress launched for compatibility since its update to version 5.5:

    Enable jQuery Migrate Helper

    Did not work for me. I’ve rolled back to version 5.8.2. and I don’t have any issues.
    I just wait until the fix has been rolled out.

    Fab

    Hi @fpuccinelli8,

    Thanks for the additional info, I will send the report to the developers that the Plugin works well in version 5.8.2 but not in 6.0. Also, here is a guide to see the debug.log file:

    – https://wordpress.org/support/article/debugging-in-wordpress/

    @lemoncpl, @rjjacob, @mikeydev, my team is investigating and working for a solution to this issue.

    Regards.

    Hi Yeisonbp,

    Sorry for the delay in my reply. This start of school has taken me away from the development of my site. FYI, I ran into more issues and had to conduct a plugin conflict test. In doing so, it lead me again to your Awesome Support plugin.

    My host provider also confired that Awesome Support plugin is causing issues.

    This is the reply I received from my host provider rep:
    vsutanovac – September 5, 2020, 05:49 a.m.
    Hi Fabio,
    My name is Vladimir WPPS team. Thanks for reaching out.
    The intermittently Error 502 isn’t related to the hosting issues.
    I’ve increased the memory limit by adding the code in wp-config.php define(‘WP_MAX_MEMORY_LIMIT’, ‘1024M’);
    Also, debug mode reported the Awesome Support plugin database issues so I deactivated it.
    Now, I am not able to use your plugin, including version 5.8.2.

    The following is a snipit of the error log:

    0`5-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/functions-templating.php on line 694
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 193
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 220
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/functions-templating.php on line 694
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 242
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 193
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 220
    [05-Sep-2020 08:49:18 UTC] PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/mg95c960pfsk/public_html/wp-content/plugins/awesome-support/includes/class-product-sync.php on line 242
    [05-Sep-2020 08:49:18 UTC] WordPress database error Table ‘i4767007_wp1.wp_sm_sessions’ doesn’t exist for query SELECT * FROM wp_sm_sessions WHERE session_key = ’71bbaba62dd022719b9dc9dd8ef99ece’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), include_once(‘/plugins/awesome-support/awesome-support.php’), WPAS, Awesome_Support::instance, Awesome_Support->init, WPAS_Session->__construct, WPAS_Session->init, WP_Session::get_instance, WP_Session->__construct, WP_Session->read_data, WP_Session_Utils::get_session, QM_DB->query
    [05-Sep-2020 08:49:18 UTC] WordPress database error Table ‘i4767007_wp1.wp_sm_sessions’ doesn’t exist for query SELECT * FROM wp_sm_sessions WHERE session_key = ‘e4595a750ac8e9892394771ef74a166e’ made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), include_once(‘/plugins/awesome-support/awesome-support.php’), WPAS, Awesome_Support::instance, Awesome_Support->init, WPAS_Session->__construct, WPAS_Session->init, WP_Session::get_instance, WP_Session->__construct, WP_Session->read_data, WP_Session_Utils::get_session, QM_DB->query`

    For now I have deactivated your plugin. Please let me and other know whe a fix has been made.

    Regards,
    Fabio Puccinelli

    Hi @fpuccinelli8,

    The continue 2 messagges were fixed with the update of the 6.0 update. A new version with bugfixes will be launched soon, so please let us know if this update works.

    Thanks.

    Hi Yeisonbp,

    Thank you for the follow-up and the great news.
    Looking forward to re-activating your plugin and to use your plugin again.

    I’ll keep an eye out for the launch of the new version.

    Fabio

    Hi @fpuccinelli8,

    Please update the plugin. We updated it a few days ago. Let us know if this update fixes your issues.

    Regards.

    Hi Yeisonbp,

    Thank you for the follow-up and the great news.
    I’ve re-activated your plugin and I will need a couple of days to see if all is good.

    Fabio

  • Viewing 15 replies — 1 through 15 (of 19 total)

    Сеанс PHP был создан вызовом функции session_start(). Это мешает REST API и петлевым запросам. Сеанс должен быть закрыт с помощью session_write_close() перед выполнением каких-либо HTTP-запросов.

    5 ответов

    Часто эта критическая проблема вызвана конфликтом в SESSION при использовании функции PHP session_start(). Например, я использовал плагин Calculation в WordPress, и после обновления версии WordPress возникла эта ошибка. Итак, я обнаружил плагин, который вызывает эту проблему, как активированные/деактивированные плагины один за другим.

    РЕШЕНИЕ этих ошибок: В диспетчере файлов моего сайта я получил файлы .php плагина и искал функцию session_start(). Там, где она использовалась после нее, я использовал эту функцию в строке session_write_close();

    Источник функции

    С уважением!


    2

    rossirm
    12 Янв 2021 в 03:03

    Была такая же проблема из-за использования плагина WP Hotel Booking. Я починил это! Мне потребовалось некоторое время, чтобы найти плагин, который он вызвал, и редактирование плагина .php не помогло. Но я исправил это, добавив фрагмент кода в functions.php темы CHILD:

    function mymodule_curl_before_request($curlhandle){
    session_write_close();
    }
    add_action( ‘requests-curl.before_request’,’mymodule_curl_before_request’, 9999 );
    

    Нашел решение здесь: https://de.wordpress.org/support/ тема/curl-error-28-und-andere-fehlermeldungen/


    7

    Eugenia Filippova
    20 Янв 2021 в 01:39

    Чтобы присоединиться к моему собственному опыту, эта проблема была решена путем отключения модуля «всплывающие перекрестные продажи» в Shopengine Pro. Действительно, в файле php. Я уведомил их об этом сегодня. Может быть, это поможет кому-то еще тем временем!


    0

    David M.
    20 Май 2022 в 00:49

    @David M., если проблема возникает конкретно с модулем всплывающих окон Cross-Sell плагина ShopEngine PRO, то ее можно исправить, добавив небольшой фрагмент кода в cross-sell-popup.php, который прочитает и немедленно закроет сеанс модуля Cross Sale Popup.

    Большое спасибо @thống nguyễn за решение.

    В строке 18, с которой начинается сеанс, замените session_start() следующим кодом:

    session_start([
        'read_and_close' => true
    ]);
    

    Надеюсь, это поможет.


    0

    Prosenjit Barman
    21 Май 2022 в 10:35

    В большинстве случаев настоящей причиной вышеуказанных ошибок является неверный механизм использования сессий PHP в плагинах или темах, когда они используют функцию session_start().

    Теперь вам нужно определить, какой плагин вызывает эту проблему, отключив ваш плагин один за другим.

    Затем в этом плагине вам нужно найти фрагмент кода, похожий на этот:

    if ( !session_id() ) {
        session_start();
    }
    

    Затем измените его на:

    if ( !session_id() ) {
        session_start( [
            'read_and_close' => true,
        ] );
    }
    

    Тогда все готово. В большинстве случаев это решит проблему. Удачи!


    22

    thống nguyễn
    30 Янв 2021 в 06:08

    Сеанс PHP был создан вызовом функции session_start(). Это мешает REST API и петлевым запросам. Сеанс должен быть закрыт с помощью session_write_close() перед выполнением каких-либо HTTP-запросов.

    3 ответа

    В большинстве случаев настоящей причиной вышеуказанных ошибок является неверный механизм использования сессий PHP в плагинах или темах, когда они используют функцию session_start().

    Теперь вам нужно определить, какой плагин вызывает эту проблему, отключив ваш плагин один за другим.

    Затем в этом плагине вам нужно найти фрагмент кода, похожий на этот:

    Затем измените его на:

    Тогда все готово. В большинстве случаев это решит проблему. Удачи!

    Часто эта критическая проблема вызвана конфликтом в SESSION при использовании функции PHP session_start() . Например, я использовал плагин Calculation в WordPress, и после обновления версии WordPress возникла эта ошибка. Итак, я обнаружил плагин, который вызывает эту проблему, как активированные/деактивированные плагины один за другим.

    РЕШЕНИЕ этих ошибок: В диспетчере файлов моего сайта я получил файлы .php плагина и искал функцию session_start() . Там, где она использовалась после нее, я использовал эту функцию в строке session_write_close();

    Используем PHP-сессии в WordPress

    Сегодня я хочу рассказать, как использовать сессии PHP в WordPress . В стандартном PHP-приложении сессия начинается после вызова функции session_start , запущенной в начале PHP-скрипта . Вам нужно открыть файл header.php используемой темы и добавить туда следующий код:

    Но этот метод сложно назвать самым эффективным. WordPress предлагает API Actions , к которому можно привязывать собственные функции. В приведенном далее примере используется как раз этот метод. Добавьте следующий код в самое начало файла functions.php .

    1. Мы воспользуемся событием init , с помощью которого можно запустить PHP-сессию . При первой инициализации WordPress мы добавляем действие, которое вызывает функцию:
    1. Далее создаем функцию start_session . Обратите внимание, что функция сначала проверяет, активна ли сессия, и только потом запускает новую сессию при помощи функции session_id :

    Закрываем PHP-сессию

    Функция session_destroy позволяет очистить сессию PHP . Но когда именно вызывать эту функцию? Многое зависит от самого приложения. WordPress также предлагает несколько способов реализовать это при помощи API Actions .

    1. В WordPress может потребоваться очистить сессию при выходе пользователя из системы, либо при авторизации нового пользователя на сайте. Для вызова функции end_session() , которую мы создадим позже, будут использоваться хуки wp_logout и wp_login :
    1. Далее создаем функцию end_session :

    Принудительное закрытие сессии

    Можно использовать собственный хук, чтобы с помощью PHP закрыть сессию в любом фрагменте шаблона. Мы воспользуемся do_action для вызова функции end_session , которую мы создали выше.

    1. В файл functions.php нужно добавить следующий код:

    Если вы все сделали правильно, то самый верх вашего файла functions.php будет выглядеть следующим образом:

    Теперь нужно добавить глобальную переменную $_SESSION , которой можно воспользоваться в любой момент при работе с приложением. Переменная является массивом, и ниже приведен пример добавления данных в массив сессии:

    Что нужно учесть:

    Если вы занимаетесь разработкой масштабируемого сайта, то возможно вам и не придется использовать эти сессии. HTTP – это протокол без запоминания состояний, сессии PHP основываются на состояниях. Сессии хранятся на сервере и обрабатываются им же. Маршрутизация каждой сессии до нужного сервера требует более сложной конфигурации, и создает проблемы для пользователей, чьи сессии хранятся на этом сервере.

    По возможности, информацию о сессиях лучше хранить в браузере. Это позволит сэкономить ресурсы сервера, а также избавиться от ненужного функционала.

    Спасибо, что были с нами! Надеюсь, вам пригодится эта статья, и если у вас возникли вопросы, обязательно задайте их в комментариях!

    Пожалуйста, опубликуйте свои отзывы по текущей теме статьи. За комментарии, лайки, дизлайки, подписки, отклики огромное вам спасибо!

    Валентин Сейидов автор-переводчик статьи « Using PHP Sessions in WordPress »

    PHP сессии для сайта плагин WordPress

    Оптимизация сайта

    Привет! Мы продолжаем разбирать самые интересные и самые полезные плагины для сайта WordPress! Сегодня я покажу вам как добавить на свой сайт PHP сессии. Данный плагин реализует собственные обработчики сессий PHP, опираясь на базу данных WordPress. Это позволяет плагинам, темам и пользовательскому коду, безопасно использовать PHP $_SESSIONs в распределенной среде, где tempfile хранилища по умолчанию в PHP просто не будет работать.

    Установить плагин WordPress Native PHP Sessions вы сможете прямо из своей админ-панели. Перейдите на страницу: Плагины — Добавить новый , введите название плагина в форму поиска, нажмите Enter, установите и активируйте плагин.

    Native PHP Sessions for WordPress

    Далее, после установки и активации плагина, перейдите на страницу: Инструменты — Sessions . Здесь у вас будут отображаться все активные php сессии. В сессии вы можете узнать:

    Понравилась статья? Поделить с друзьями:
  • Обновление windows 10 ошибка 0хс190011f
  • Обнаружен сбой или отключение графического устройства destiny 2 код ошибки broccoli
  • Нсд ошибка 81 тахограф vdo что означает
  • Обновление play services исправление ошибок
  • Обнаружен поврежденный заголовок winrar как исправить