{"id":13286,"date":"2023-09-21T02:43:18","date_gmt":"2023-09-21T06:43:18","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=13286"},"modified":"2023-09-21T02:43:23","modified_gmt":"2023-09-21T06:43:23","slug":"how-to-disable-output-buffering-in-php","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/","title":{"rendered":"How to Disable Output Buffering in PHP"},"content":{"rendered":"\n

In PHP, you can disable output buffering using the ob_<\/code> (output buffering) functions. Output buffering is a mechanism that allows you to capture and manipulate the output sent to the browser before it is actually displayed. Disabling it means that output will be sent to the browser immediately as it is generated, without being stored in a buffer. Here’s how you can disable output buffering in PHP:<\/p>\n\n\n\n

Using ob_end_flush()<\/code>:<\/p>\n\n\n\n

The ob_end_flush()<\/code> function is used to flush (send) the output buffer and turn off output buffering. You should call this function at the beginning of your script to disable output buffering:<\/p>\n\n\n\n

<?php\nob_end_flush();\n\/\/ Your PHP code here\n?><\/code><\/pre>\n\n\n\n

Using ini_set()<\/code>:<\/p>\n\n\n\n

You can also disable output buffering by changing the PHP configuration settings using ini_set()<\/code>:<\/p>\n\n\n\n

<?php\nini_set('output_buffering', 'off');\n\/\/ Your PHP code here\n?><\/code><\/pre>\n\n\n\n

Please note that the ability to change the output_buffering<\/code> setting using ini_set()<\/code> may depend on your server’s configuration and PHP version. Some servers may restrict the ability to change certain settings at runtime.<\/p>\n\n\n\n

By disabling output buffering, the content generated by your PHP script will be sent directly to the browser as it is generated, which is useful when you want to stream data or send output in real-time without any buffering delay.<\/p>\n","protected":false},"excerpt":{"rendered":"

In PHP, you can disable output buffering using the ob_ (output buffering) functions. Output buffering is a mechanism that allows you to capture and manipulate the output sent to the…<\/p>\n","protected":false},"author":1,"featured_media":13287,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,9,16],"tags":[424,433,449,452,471,544,635,636,638],"yoast_head":"\nHow to Disable Output Buffering in PHP<\/title>\n<meta name=\"description\" content=\"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Disable Output Buffering in PHP\" \/>\n<meta property=\"og:description\" content=\"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-21T06:43:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-21T06:43:23+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Disable Output Buffering in PHP\",\"datePublished\":\"2023-09-21T06:43:18+00:00\",\"dateModified\":\"2023-09-21T06:43:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\"},\"wordCount\":191,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg\",\"keywords\":[\"Open Source\",\"Optimization\",\"Performance\",\"PHP\",\"Programming\",\"Software development\",\"Web\",\"Web Applications\",\"Web Development\"],\"articleSection\":[\"Articles\",\"Guides\",\"How To\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\",\"url\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\",\"name\":\"How to Disable Output Buffering in PHP\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg\",\"datePublished\":\"2023-09-21T06:43:18+00:00\",\"dateModified\":\"2023-09-21T06:43:23+00:00\",\"description\":\"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg\",\"width\":1280,\"height\":680,\"caption\":\"disable output buffering PHP\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Disable Output Buffering in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Disable Output Buffering in PHP","description":"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/","og_locale":"en_US","og_type":"article","og_title":"How to Disable Output Buffering in PHP","og_description":"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it","og_url":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2023-09-21T06:43:18+00:00","article_modified_time":"2023-09-21T06:43:23+00:00","og_image":[{"width":1280,"height":680,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Disable Output Buffering in PHP","datePublished":"2023-09-21T06:43:18+00:00","dateModified":"2023-09-21T06:43:23+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/"},"wordCount":191,"commentCount":0,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg","keywords":["Open Source","Optimization","Performance","PHP","Programming","Software development","Web","Web Applications","Web Development"],"articleSection":["Articles","Guides","How To","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/","url":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/","name":"How to Disable Output Buffering in PHP","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg","datePublished":"2023-09-21T06:43:18+00:00","dateModified":"2023-09-21T06:43:23+00:00","description":"In PHP, you can disable output buffering using the ob_ (output buffering) functions or using ini_set and this post explains how to do it","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2023\/09\/disable-output-buffering.jpg","width":1280,"height":680,"caption":"disable output buffering PHP"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/how-to-disable-output-buffering-in-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Disable Output Buffering in PHP"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/13286"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=13286"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/13286\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/13287"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=13286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=13286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=13286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}