A cached modx_core_path stops site move?

Have done many times before, but now it doesn’t work. Moving a MODX website from one CPanel account to another, both set to the same 8.1PHP configuration. First a new blank MODX 3.1 installation, then import the previous data for the database and copy all the files. Normally works fine.

The difference this time is that previously the site used a domain name that was an addon for the CPanel account, not the main domain name, so it used a filepath different from the public_html root. In the new CPanel account, it is the main domain name and is using the normal public_html root.

Now, the manager area works fine, but the front end triggers a 503 error with the message: Site temporarily unavailable; missing dependencies. And I cannot run setup for a second time. I bought a new copy of Bob’s life-saving sitecheck, but it also triggers a big pink error and stops prematurely.

The MODX error log:

PHP Fatal error: Uncaught Error: Failed opening required ‘/home/chalkstream/millstreambarndotcom/core/vendor/autoload.php’ (include_path=‘.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php’) in /home/chalkstream/public_html/index.php:29
Stack trace:
#0 {main}
thrown in /home/chalkstream/public_html/index.php on line 29

This filepath is wrong: /home/chalkstream/millstreambarndotcom/core/vendor/autoload.php

That was the right filepath for the old installation. The new filepath is: /home/chalkstream/public_html/core/vendor/autoload.php

The problem seems to come from a cached value for modx_core_path on line 29 of the index file for the front end of the site. I have emptied the core/cache folder numerous times, And emptied the browser’s cache.

If the core_path value is the problem, where is it being stored? I don’t see it on the config.inc or config.core files or in the system and server settings in the MODX manager?

Hey @cottagestuff

Normally I’d check & update all of the paths in the following four files:

config.core.php
core/config/config.inc.php
connectors/config.core.php
manager/config.core.php

And then delete the core/cache folder.

1 Like

Thank you very much dejaya. I think I have found it now. I was sure I created the new installation with blank config files so I didn’t copy over any of the old config settings. But I accidentally left one of the old config.core files with the old core path. Found that and corrected the path now and it works.

Thanks again.

1 Like

Can’t see how you can indicate that the question is answered and no further replies are needed.

You just need to mark one of the responses as the solution - it’ll then be closed shortly after

The topic was not in a category. In the Support category it will have a Solution Mark option available. I’ve moved it into Support and now you can mark a solution. Thanks to @dejaya for the help.

1 Like