New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues on shared hosting with PHP version above 5.4 #13002
Comments
Sounds like a problem with the server configuration or something. Looking at the diff, the PHP configurations looks correct. Do you have anything in your error logs? From the web server or MODX's. |
In the package manager page firebug shows error in ext-all.js: |
The JSON is invalid. You can see that the string that should be the value of "results" is empty. This is most likely because you have invalid characters in your data. I see in your config you have russian language. The issue may be caused by something like this: http://stackoverflow.com/questions/10205722/json-encode-invalid-utf-8-sequence-in-argument What charset does you mysql database have? |
Russian language. Charset is utf-8 (in mysql - utf8_general_ci). I have no problems with charsets on website or server, as I always use Unicode. |
apache 2.4? invalid json on this version |
Is this a MODX bug? Because other CMS works fine with this version of Apache. How can I solve it? |
I don't know if it's a MODX bug. If it is, it's definitely specific to something in your environment (and perhaps the environment in #13011 - anything in common between those reports perhaps?), as I can access the packages just fine running PHP 5.4, 5.6 and 7.0. |
As @OptimusCrime already said: There must be an issue with your charset (MODX charset, database charset, database table charset or database field charset) because the value of |
Everything semms to be fine with charsets, UTF-8 is set everywhere (actually, charset not changing while switching PHP version from 5.4 to 5.5 or higher). |
I had the same issue. |
Interesting, could you try it with |
Thanks to @jdaehne and @Jako - setting the locale parameter in System settings solved problem with Package Manager and Logs->System information. Right setting for my case was "ru_RU.utf8". It works now for PHP 7.0 (I had empty "locale" parameter in system settings and it didn't cause any issues in PHP 5.4). But the thumbnails in Media Manager still not showing... Even after full cache clearing and sessions reset. |
Nice! Setting locale to |
@kwazaro There is at least one PHP7 issue left in MODX phpThumb, that could cause missing thumbnails in the manager. This could be temporarily solved by changing the phpThumb constructor in https://github.com/modxcms/revolution/blob/2.x/core/model/phpthumb/phpthumb.class.php#L218 from phpThumb to __construct. There will be a better fix for this in 2.5.1 or 2.5.2 |
Using the right locale setting should be mentioned in the RTFM. |
@Jako thanks for help! Changing the constructor function name "phpThumb()" to "__construct()" in phpthumb.class.php in line 218 helped. Thumbnails are showing now. I hope this will be fixed on next version of MODx. |
The phpThumb class is updated with this PR: #13039 It would be nice if you could check this out and tell us your efforts, please. |
@kwazaro Are you sure that the MODX system setting locale was empty, when the issues occured? Or did you use a non UTF-8 locale like |
I have some differrent sites with modx, and all of them have system setting "locale" empty (by default, I didn't change it after fresh installation). This is OK on PHP 5.4, but on PHP version above 5.4 caused problems. Issues gone when a set this setting to "ru_RU.utf8" on site with PHP7. I have checked #13039 - seems to work without issues. |
Does the system work with PHP7 if you use |
If I use "en" as manager language - system works fine on PHP7, BUT only if "locale" parameter is set (like "en_GB.utf8"). If i leave locale parameter empty - issues comes back (package manager doesn't work, empty values in reports etc.). |
Ok, thanks for the info. Could you look into a PHP7 MODX installation and see what is the output for [[++locale]] in the frontend with an empty locale system setting? Maybe there is a not utf8 capable default value for this in php.ini. |
If "locale" setting is empty, the output of [[++locale]] is empty too. |
So maybe the locale system setting has to be filled with |
It is good idea to fill this setting by default during installation or update to locale, which depends on selected language during install/update, for example, "en_GB.utf8" for English, or "ru_RU.utf8" for Russian. |
Shouldn't this just be configured properly on the server by default? The way I see the locale setting, it is a way to override the default but for the vast majority the server configuration should be just fine? |
Depends on how your system is defined? I can easily install/remove locales on my server. There is no guarantee that those locales are available as far as I know. I do not have "ru_RU.utf8" installed on my servers. |
The phpThumb version is upgraded and the PHP7 issue is solved there. Only the locale setting could cause PHP7 issues then. I have opened another Issue for that. |
Summary
On the shared hosting ukraine.com.ua when I change the PHP version from 5.4 to 5.5, 5.6 or 7.0 there are some strange bugs in Manager, On the frontend all seems to work fine, The settings and hosting PHP configs satisfies MODx requirements and they are not changing during PHP version switching. Hosting support couldn't help.
Step to reproduce
On the shared hosting panel in Ukraine.com.ua change PHP version from 5.4 to 5.5, 5.6 or 7. This issues present on existing sites and on fresh install (installation goes with no problems). Modx Revo v2.5.0.
Observed behavior
the package manager not working correctly (showing LOADING... but can't load any package list from repo). Also, there is no image thumbnails in Media Manager or in Resource Edit Page (with image TV). In REPORTS -> SYSTEM INFORMATION menu item in Manager not showing some data (the Modx version, version codename, local and server time, database type, db version, db encoding etc.). On PHP 5.4 this information showing correctly)
Expected behavior
There is no issues on the same hosting with PHP 5.4.
Environment
I can attach file with comparison of two phpinfo() outputs: first is from working MODx website with PHP 5.4 and the second - the same system, but with PHP 7 (with issues), maybe it can help to find differrence between settings.
compare-phpinfo.zip
The text was updated successfully, but these errors were encountered: