rastographics Posted January 31, 2019 Share Posted January 31, 2019 (edited) 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 February 1, 2019 by rastographics Remove sensitive server info Link to comment Share on other sites More sharing options...
adrian Posted January 31, 2019 Share Posted January 31, 2019 Probably a permissions issue with the site/assets/files folder - check that the owner and perms match what you had in the staging setup. 2 Link to comment Share on other sites More sharing options...
psy Posted February 1, 2019 Share Posted February 1, 2019 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/ Link to comment Share on other sites More sharing options...
rastographics Posted February 1, 2019 Author Share Posted February 1, 2019 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. Link to comment Share on other sites More sharing options...
adrian Posted February 1, 2019 Share Posted February 1, 2019 Glad you have it working, but maybe rather than changing the permissions, you should change the owner of the files to match the apache user ? https://processwire.com/docs/security/file-permissions/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now