I’m struggling to upgrade a 2.7.1 site. I’ve tried upgrading to 2.7.3 and 2.8.0 but cant get beyond the first setup page: ERROR: Your MODX_CORE_PATH is invalid; please specify the correct path in the field above and click Submit. The path has to contain a trailing slash.
No, it should point to the “core” directory of MODX. The directory that contains the bulk of the PHP code for MODX. Most likely located in the “public_html” folder.
(The code specifically tests if the files xpdo/xpdo.class.php and model/modx/modx.class.php exist in the specified folder.)
Yes that’s what I thought. I don’t know why it defaults to point to the setup directory.
I’ve now been able to upgrade to the latest version.
I did get an error on the next page after adding the correct ‘core’ path… Deprecated*: Array and string offset access syntax with curly braces is deprecated in /home2/mywebsite/public_html/setup/includes/parser/modinstallsmarty.class.php on line *75
But changing the PHP down to 7.3 solved the above deprecation warning and i was then able to upgrade to 2.8.0 and change PHP back to 7.4.
The variable is defined in the file config.core.php (in the webroot).
The value of this variable has to be set correctly for MODX to work. So if your website worked correctly before the upgrade, I have no clue why the value during the upgrade would suddenly be incorrect.
I did some testing and this seems to be a problem with the UpgradeMODX extra.
During the setup, the MODX core path is defined in the file setup/includes/config.core.php.
By default (during a manual upgrade), MODX_CORE_PATH is defined like this:
UpgradeMODX however changes the content of the file setup/includes/config.core.php before the setup runs. The content of the file config.core.php (in the webroot) gets copied to the file setup/includes/config.core.php (here in the code).
This works ok, if the core path in config.core.php is an absolute path, but creates a problem with dirname(__FILE__) (as the directory path now includes setup/includes/).
Thanks for the thoughts however I don’t think that would be the whole answer. According to Bob Ray there are four such files in different directories I checked every one of them and they all read the same.
I solved my problem by changeing the path here
so that it pointed to the correct location.
It worked and we are now running 2.8.5.
Obviously I still have no idea where the strange path came from and unless Bob Ray responds I probably never will.
One silver lining from all this was that I discovered how brilliant our hosting provider is. Krystal take regular backups and make them available to users. When it crashed on my first failed attempt It took 48 seconds to do the restore,much quicker than a cPanel backup and restore.