المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : حل مشكلة Warning: Cannot modify header information - headers already sent by



Rise Company
29-11-2017, 01:50
حل جميع مشاكل session_start()

قد تظهر بعض الاخطاء فى الوورد بريس مثل


Warning: Cannot modify header information - headers already sent by

Warning: session_start(): Cannot send session cache limiter - headers already sent



wordpress Warning: session_start(): Cannot send session cookie

الحل هو تفعيل
output_buffering = On

من خلال هذا المسار
Home »Service Configuration »PHP Configuration Editor

This turns on PHP's output buffering feature. In PHP when you output something (do an echo or print) if has to send the HTTP headers at that time. If you turn on output buffering you can output in the script but PHP doesn't have to send the headers until the buffer is flushed. If you turn it on and don't turn it off PHP will automatically flush everything in the buffer after the script finishes running. There really is no harm in just turning it on in almost all cases and could give you a small performance increase under some configurations.

If you have access to change your php.ini configuration file you can find and change or add the following
output_buffering = On This will turn output buffering out without the need to call ob_start().


المرجع:
https://stackoverflow.com/questions/9707693/warning-cannot-modify-header-information-headers-already-sent-by-error