503 after PHP Version Update 5.4 -> 7.2

After updating the PHP Version from 5.4 to 7.2, I get a 503 error on my site. I tried to run the setup again, but it claims Your MODX_CORE_PATH is invalid. The prefilled core path in this field was indeed invalid as I have moved my core above my root and it was aiming for the root, but it would not let me fix it to the right path.

I tried deleting the cache, reverting to the original PHP version and I checked the paths in the config files (which are still correct, as I haven’t changed anything with the files). All without success.

I had changed the PHP Version from a few other websites without a problem, but this one is giving me troubles. It is a multilangual site, running with Babel and XRouting which might have to do something with it?

MODX 2.7.2

One thing you could possibly try is turning on display errors:

ini_set('display_errors', 1); 

I know there were quite a few changes in PHP 7, including some deprecated functions etc. MODx is one of those platforms where one line of errant code might give you a PHP error that rarely describes the issue in the degree of detail we developers would like.

Personally, I also modified my own index.php files on my client websites to invoke Bugsnag to catch any and all I caught exceptions from PHP which has saved my bacon on quite a number of occasions! Setting up Bugsnag here might give you a stacktrace to follow.

Outside of Bugsnag, you can also check your server logs too (if you have cPanel I believe there is a module in thrash board that takes you right to the logs). Depending on your hosting provider situation those logs may or may not have what you’re looking for…

Are you still able to log into the manager after upgrading or does that also return a 503?

Definitely check your php error logs on your server. If you don’t know where those are your hosting provider should be able to point you in the right direction.

Check the config.core.php file in the MODX root directory and modify the core path if necessary. If you have to, you can also modify the one in setup/includes.

Check the paths and URLs in core/config/config.inc.php.

@cjholowatyj I would put that in the root index.php, right? If so, there’s no results unfortunately.

@bobray All paths in those files are correct. I don’t think they could have changed anyway, as I have only updated the PHP Version?

@nick2687 Manager also returns a 503. I checked my PHP logs only to find that they were disabled to begin with. After I fixed that, I did get a Warning while running the setup:

mod_fcgid: stderr: PHP Warning: file_exists(): open_basedir restriction in effect. [...]

That led me to the open_basedir setting, which I resetted to the default:

# from 
{DOCROOT}{/}{:}{TMP}{/}{:}{/}var{/}lib{/}php5{/}sessions{:}{/}var{/}lib{/}php{/}sessions{:}{WEBSPACEROOT}{/}tmp

# to
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}lib{/}php5{/}sessions{:}{/}var{/}lib{/}php{/}sessions

I have no idea, if this is a “good” setting or not, or what else I should be aware of here, but the site is back online now. If I should be careful with something here or any more insights are highly appreciated. Thank you all for the help!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.