Jump to content

Error when moving to production...

Recommended Posts

Site works great on staging, moved to production (different folder/user on same server), site front-end works, but trying to create a new page on the backend gives this error:

DirectoryIterator::__construct(../releases/1548970736/site/assets/files/1140/): failed to open dir: No such file or directory (in /wire/core/Pageimages.php line 134)



The database is an exact copy. Only thing I didn't copy over was the backups/cache/logs directories from assets. (I did copy the "files" directory).

The folder it is referencing "site/assets/files/1143" ...that directory never existed on staging or production. Don't know why it's trying to call that directory from the getAllVariations() method in wire/core/Pageimages.php???


It gives this error no matter where in the tree i try to create a new page.


EDIT: Just realized that the "1143" in the error message "site/assets/files/1143" is the id of the new page I'm trying to create.

Edited by rastographics
Remove sensitive server info

Share this post

Link to post
Share on other sites

Probably a permissions issue with the site/assets/files folder - check that the owner and perms match what you had in the staging setup.

  • Like 2

Share this post

Link to post
Share on other sites

Did you update the site/config.php file $config->httpHosts array to include the new domain name? And/or change the root dir in your .htaccess file?

Had similar issue today where dev site on same server with same db was moved to new domain name and different site path, eg

From: http://999.99.99.99/~myclient dir/ to http://www.myclientsite.com


1/ Make changes to the /site/config.php httpHosts whitelist to add the new domain name:


* Installer: HTTP Hosts Whitelist



$config->httpHosts = array(






2/ Make a change to the .htaccess file to update it from the old site root to the new site root:

# -----------------------------------------------------------------------------------------------

  # 11. OPTIONAL: Set a rewrite base if rewrites aren't working properly on your server.

  # And if your site directory starts with a "~" you will most likely have to use this.

  # -----------------------------------------------------------------------------------------------


  # RewriteBase /

  # RewriteBase /pw/

  # RewriteBase /~user/

  # RewriteBase /~myclient/


Share this post

Link to post
Share on other sites

thanks everyone, @adrian it was indeed permissions issue. happened because I had copied the assets/files from old site to new using root user, but apache configured to run as a different user per site. 

To help anyone who finds this, I ran:

cmod -R 775

 on the assets/files folder, as root.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...