{"id":1597,"date":"2019-02-08T10:35:53","date_gmt":"2019-02-08T10:35:53","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2019\/02\/08\/1583195-how-to-fix-the-php-cannot-redeclare-error-at-hostinger\/"},"modified":"2019-02-08T10:35:53","modified_gmt":"2019-02-08T10:35:53","slug":"1583195-how-to-fix-the-php-cannot-redeclare-error-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/1583195-how-to-fix-the-php-cannot-redeclare-error-at-hostinger\/","title":{"rendered":"How to Fix the PHP Cannot Redeclare Error at Hostinger"},"content":{"rendered":"<p class=\"no-margin\">In case you encounter a &ldquo;<b>PHP Fatal error: Cannot redeclare function<\/b>&rdquo; or any similar message on your website, it means that your script is trying to declare the same function multiple times, either due to the function being defined in <b>two or more separate files<\/b>, or two or more <b>places within the same file<\/b><\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To fix it, check the full error message for information such as the filename and path: <\/p><ul>\n<li>\n<p class=\"no-margin\">If declared in <b>different files<\/b>, the error message will show in which file this function was previously declared. Check your code and decide in which <b>unique file<\/b> to declare the function, then remove it from any other files<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">For functions included more than once on the <b>same file<\/b>, open the file using the <b><a href=\"\/support\/7949267-how-to-use-the-file-editor-at-hostinger\" target=\"_blank\" class=\"intercom-content-link\">File Editor<\/a><\/b> and use <b><a href=\"http:\/\/www.php.net\/manual\/en\/function.include-once.php\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">include_once<\/a><\/b> instead of <b><a href=\"http:\/\/www.php.net\/manual\/en\/function.include.php\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">include<\/a><\/b><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Fixing &#8220;Fatal error: Cannot redeclare&#8221;<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[230],"tags":[],"class_list":["post-1597","post","type-post","status-publish","format-standard","hentry","category-php-advanced"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/1583195-how-to-fix-the-php-cannot-redeclare-error-at-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/1583195-como-reparar-el-error-fatal-de-php-no-se-puede-volver-a-declarar-en-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/1583195-comment-reparer-php-fatal-error-cannot-redeclare-chez-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/1583195-bagaimana-cara-memperbaiki-error-php-fatal-error-cannot-redeclare-di-hostinger\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/1583195-como-corrigir-o-erro-fatal-error-cannot-redeclare-function-no-hostinger\/","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/1583195----php-cannot-redeclare-hostinger\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1597"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1597\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}