rastographics

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???

image.thumb.png.8466422099bc0f3bec6e8bb8921caf7a.png

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(

    'www.mysite.com',

    'mysite.com',

    '999.99.99.99'

    );

  

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.