Title: Installer.php fails with PHP error
Last modified: April 14, 2023

---

# Installer.php fails with PHP error

 *  Resolved [colevalleygirl](https://wordpress.org/support/users/colevalleygirl/)
 * (@colevalleygirl)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/)
 * Installer.php is failing to run on my new (empty) site.
 * 2 error message.
 * One is about an unterminated comment at the end of the file (easy to fix and 
   already reported here by somebody else).
 * The other says:
 * PHP Fatal error: Namespace declaration statement has to be the very first statement
   or after any declare call in the script in /home/xxx/xxx/installer.php on line
   12
 * Update:
 * I’ve tried deleting the initial comment as suggested here [Comment at start of installer resulting in 500 error | WordPress.org](https://wordpress.org/support/topic/comment-at-start-of-installer-resulting-in-500-error/),
   and as long as I delete all the associated white space it work.
    -  This topic was modified 3 years, 1 month ago by [colevalleygirl](https://wordpress.org/support/users/colevalleygirl/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [mohammedeisa](https://wordpress.org/support/users/mohammedeisa/)
 * (@mohammedeisa)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16663746)
 * Hi [@colevalleygirl](https://wordpress.org/support/users/colevalleygirl/) ,
 * Thanks for reaching out to us.
   About the below error:_Namespace declaration statement
   has to be the very first statement or after any declare call in the script in/
   home/xxx/xxx/installer.php on line 12_
 * 
   I believe that the below FAQ will help you to fix your issue
    - How to fix general installer UI & bootstrap/archive issues?
    - [https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-050-q](https://snapcreek.com/duplicator/docs/faqs-tech/#faq-installer-050-q)
 * Could you please let me know what is the encoding of the installer.php?
 * I’m looking forward to your reply.
 * Thanks!
 *  Thread Starter [colevalleygirl](https://wordpress.org/support/users/colevalleygirl/)
 * (@colevalleygirl)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16665301)
 * The installer.php encoding is UTF-8
 * It begins:
 *     ```wp-block-code
       <?php
       /* ------------------------------ NOTICE ----------------------------------
   
       If you're seeing this text when browsing to the installer, it means your
       web server is not set up properly.
   
       Please contact your host and ask them to enable "PHP" processing on your
       account.
       ----------------------------- NOTICE --------------------------------- */
       namespace {
       use Duplicator\Libs\DupArchive\DupArchiveExpandBasicEngine;
       $disabled_dirs = array(
       'backups-dup-lite',
       'wp-snapshots'
       );
       if (in_array(basename(dirname(FILE)), $disabled_dirs)) {
       die;
       }
       ```
   
 * The white space at the top, plus the entire NOTICE comment must be removed to
   make the installer work.
 * It ends:
 * > /* DUPLICATOR_INSTALLER_EO
 * This comment needs to be terminated properly to make the installer work.
 *  Plugin Support [mohammedeisa](https://wordpress.org/support/users/mohammedeisa/)
 * (@mohammedeisa)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16667078)
 * Hi [@colevalleygirl](https://wordpress.org/support/users/colevalleygirl/) ,
 * Please try to change the installer.php encoding to **ANSI**.
 * To do that, open the installer.php in notepad++ , click encoding, and select **
   ANSI**
 * Please let me know if this works.
 * Thanks!
 *  Thread Starter [colevalleygirl](https://wordpress.org/support/users/colevalleygirl/)
 * (@colevalleygirl)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16668094)
 * How is changing the encoding going to fix these error which are identical to 
   what I experienced:
 * [Comment at start of installer resulting in 500 error | WordPress.org](https://wordpress.org/support/topic/comment-at-start-of-installer-resulting-in-500-error/)
 * [Bad Comment at end of installer.php | WordPress.org](https://wordpress.org/support/topic/bad-comment-at-end-of-installer-php/)
 * As that first problem report is 6 months old, I’m somewhat surprised it hasn’t
   been fixed already.
 *  Plugin Support [mohammedeisa](https://wordpress.org/support/users/mohammedeisa/)
 * (@mohammedeisa)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16697155)
 * Hi [@colevalleygirl](https://wordpress.org/support/users/colevalleygirl/) ,
 * This issue has been fixed already. Are you using the latest Duplicator version?
 * If you are using the latest Duplicator Lite version, please contact Duplicator
   Pro support to investigate this issue:
   [https://duplicator.com/contact/?form=1](https://duplicator.com/contact/?form=1)
 * Thanks!
 *  Thread Starter [colevalleygirl](https://wordpress.org/support/users/colevalleygirl/)
 * (@colevalleygirl)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16697432)
 * I’m using Duplicator Light 1.5.3.1. I will contact Developer Pro support.
 *  Plugin Support [mohammedeisa](https://wordpress.org/support/users/mohammedeisa/)
 * (@mohammedeisa)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16715335)
 * Hi [@colevalleygirl](https://wordpress.org/support/users/colevalleygirl/) ,
 * I’m closing here since you are already in contact with Duplicator Pro support.
 * Please don’t hesitate to open a new ticket in you need help.
 * Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Installer.php fails with PHP error’ is closed to new replies.

 * ![](https://ps.w.org/duplicator/assets/icon-256x256.png?rev=2906985)
 * [Duplicator - Backups & Migration Plugin - Cloud Backups, Scheduled Backups, & More](https://wordpress.org/plugins/duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicator/reviews/)

## Tags

 * [installer](https://wordpress.org/support/topic-tag/installer/)

 * 7 replies
 * 2 participants
 * Last reply from: [mohammedeisa](https://wordpress.org/support/users/mohammedeisa/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/installer-php-fails-with-php-error/#post-16715335)
 * Status: resolved