{"id":1732,"date":"2026-06-17T07:02:06","date_gmt":"2026-06-17T07:02:06","guid":{"rendered":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/"},"modified":"2026-07-25T15:39:14","modified_gmt":"2026-07-25T13:39:14","password":"","slug":"php-error-cannot-modify-header-information","status":"publish","type":"docs","link":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/","title":{"rendered":"PHP Error: \u201eCannot modify header information&#8221;"},"content":{"rendered":"<p>Aceast\u0103 eroare (<em>Cannot modify header information \u2013 headers already sent<\/em>) apare c\u00e2nd se trimite con\u021binut c\u0103tre browser \u00eenainte de apelul unei func\u021bii care modific\u0103 anteturile (ex. <code>header()<\/code>, <code>setcookie()<\/code>, <code>session_start()<\/code>). Cauze uzuale:<\/p>\n<ul>\n<li>spa\u021bii, text sau un caracter <strong>BOM<\/strong> \u00eenainte de tag-ul <code>&lt;?php<\/code> (sau dup\u0103 <code>?&gt;<\/code>);<\/li>\n<li>un <code>echo<\/code>\/<code>print<\/code> executat \u00eenainte de <code>header()<\/code>.<\/li>\n<\/ul>\n<p>Mesajul de eroare indic\u0103 fi\u0219ierul \u0219i linia care au trimis primul output. Dac\u0103 sunt incluse mai multe fi\u0219iere, verific\u0103-le individual \u2014 \u00eencepe cu cel semnalat \u00een eroare.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aceast\u0103 eroare (Cannot modify header information \u2013 headers already sent) apare c\u00e2nd se trimite con\u021binut c\u0103tre browser \u00eenainte de apelul unei func\u021bii care modific\u0103 anteturile (ex. header(), setcookie(), session_start()). Cauze uzuale: spa\u021bii, text sau un caracter BOM \u00eenainte de tag-ul &lt;?php (sau dup\u0103 ?&gt;); un echo\/print executat \u00eenainte de header(). Mesajul de eroare indic\u0103 fi\u0219ierul &#8230; <a title=\"PHP Error: \u201eCannot modify header information&#8221;\" class=\"read-more\" href=\"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/\" aria-label=\"Cite\u0219te mai multe despre PHP Error: \u201eCannot modify header information&#8221;\">Cite\u0219te mai mult<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"whmcs_kb_id":450,"footnotes":""},"doc_category":[169],"doc_tag":[363,279,247,248],"class_list":["post-1732","docs","type-docs","status-publish","hentry","doc_category-php","doc_tag-debugging","doc_tag-erori","doc_tag-php","doc_tag-troubleshooting"],"year_month":"2026-08","word_count":86,"total_views":"26","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Adrian Firican","author_nicename":"techeditor1","author_url":"https:\/\/www.hostx.ro\/kb\/author\/techeditor1\/"},"doc_category_info":[{"term_name":"PHP","term_url":"https:\/\/www.hostx.ro\/kb\/docs-category\/php\/"}],"doc_tag_info":[{"term_name":"debugging","term_url":"https:\/\/www.hostx.ro\/kb\/docs-tag\/debugging\/"},{"term_name":"erori","term_url":"https:\/\/www.hostx.ro\/kb\/docs-tag\/erori\/"},{"term_name":"PHP","term_url":"https:\/\/www.hostx.ro\/kb\/docs-tag\/php\/"},{"term_name":"Troubleshooting","term_url":"https:\/\/www.hostx.ro\/kb\/docs-tag\/troubleshooting\/"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP Error: \u201eCannot modify header information&quot; - Centrul de suport HostX<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/\" \/>\n<meta property=\"og:locale\" content=\"ro_RO\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Error: \u201eCannot modify header information&quot; - Centrul de suport HostX\" \/>\n<meta property=\"og:description\" content=\"Aceast\u0103 eroare (Cannot modify header information \u2013 headers already sent) apare c\u00e2nd se trimite con\u021binut c\u0103tre browser \u00eenainte de apelul unei func\u021bii care modific\u0103 anteturile (ex. header(), setcookie(), session_start()). Cauze uzuale: spa\u021bii, text sau un caracter BOM \u00eenainte de tag-ul &lt;?php (sau dup\u0103 ?&gt;); un echo\/print executat \u00eenainte de header(). Mesajul de eroare indic\u0103 fi\u0219ierul ... Cite\u0219te mai mult\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/\" \/>\n<meta property=\"og:site_name\" content=\"Centrul de suport HostX\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-25T13:39:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/php-error-cannot-modify-header-information\\\/\",\"url\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/php-error-cannot-modify-header-information\\\/\",\"name\":\"PHP Error: \u201eCannot modify header information\\\" - Centrul de suport HostX\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/#website\"},\"datePublished\":\"2026-06-17T07:02:06+00:00\",\"dateModified\":\"2026-07-25T13:39:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/php-error-cannot-modify-header-information\\\/#breadcrumb\"},\"inLanguage\":\"ro-RO\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/php-error-cannot-modify-header-information\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/php-error-cannot-modify-header-information\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Prima pagin\u0103\",\"item\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"InfoCentru\",\"item\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PHP Error: \u201eCannot modify header information&#8221;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/\",\"name\":\"Centrul de suport HostX\",\"description\":\"tutoriale gazduire web, domenii web \u0219i servere\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hostx.ro\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ro-RO\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP Error: \u201eCannot modify header information\" - Centrul de suport HostX","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":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/","og_locale":"ro_RO","og_type":"article","og_title":"PHP Error: \u201eCannot modify header information\" - Centrul de suport HostX","og_description":"Aceast\u0103 eroare (Cannot modify header information \u2013 headers already sent) apare c\u00e2nd se trimite con\u021binut c\u0103tre browser \u00eenainte de apelul unei func\u021bii care modific\u0103 anteturile (ex. header(), setcookie(), session_start()). Cauze uzuale: spa\u021bii, text sau un caracter BOM \u00eenainte de tag-ul &lt;?php (sau dup\u0103 ?&gt;); un echo\/print executat \u00eenainte de header(). Mesajul de eroare indic\u0103 fi\u0219ierul ... Cite\u0219te mai mult","og_url":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/","og_site_name":"Centrul de suport HostX","article_modified_time":"2026-07-25T13:39:14+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/","url":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/","name":"PHP Error: \u201eCannot modify header information\" - Centrul de suport HostX","isPartOf":{"@id":"https:\/\/www.hostx.ro\/kb\/#website"},"datePublished":"2026-06-17T07:02:06+00:00","dateModified":"2026-07-25T13:39:14+00:00","breadcrumb":{"@id":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/#breadcrumb"},"inLanguage":"ro-RO","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hostx.ro\/kb\/php-error-cannot-modify-header-information\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Prima pagin\u0103","item":"https:\/\/www.hostx.ro\/kb\/"},{"@type":"ListItem","position":2,"name":"InfoCentru","item":"https:\/\/www.hostx.ro\/kb\/docs\/"},{"@type":"ListItem","position":3,"name":"PHP Error: \u201eCannot modify header information&#8221;"}]},{"@type":"WebSite","@id":"https:\/\/www.hostx.ro\/kb\/#website","url":"https:\/\/www.hostx.ro\/kb\/","name":"Centrul de suport HostX","description":"tutoriale gazduire web, domenii web \u0219i servere","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostx.ro\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ro-RO"}]}},"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/docs\/1732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/comments?post=1732"}],"version-history":[{"count":2,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/docs\/1732\/revisions"}],"predecessor-version":[{"id":5204,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/docs\/1732\/revisions\/5204"}],"wp:attachment":[{"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/media?parent=1732"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/doc_category?post=1732"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hostx.ro\/kb\/wp-json\/wp\/v2\/doc_tag?post=1732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}