Page 1 of 1

[SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Sun Mar 17, 2019 1:34 am
by eire
Hi,
My current website is on version 1.5.5.1 and I am trying to migrate to 2.3.0.2 so I recently setup a dev sub-folder and installed OC there.

When I go to login to the admin area, I get the following error:
Warning: htmlspecialchars(): charset `UTF-8;' not supported, assuming utf-8 in /public_html/dev/system/library/cart/user.php on line 39Warning: Cannot modify header information - headers already sent by (output started at /public_html/dev/admin/controller/startup/error.php:34) in /public_html/dev/system/library/response.php on line 12.

I have not installed any extensions or theme.

Note: When I created the DB, it defaulted to the swedish default but I have since updated it to utf8_general_ci

As suggested in another forum post, I amended the php.ini and admin/php.ini files. I removed the semicolon from the end of each line but it did not resolve the issue.

If anyone has any suggestions as to how I can resolve this, it would be much appreciated.

Thanks,
Philip

Re: Dev Site Setup, Admin Login Error: Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Sun Mar 17, 2019 2:12 am
by ADD Creative
In the php.ini and admin/php.ini files. You need remove the semicolon from the end of each line.

So

Code: Select all

default_charset	= UTF-8;
To

Code: Select all

default_charset	= UTF-8
If you are using cPanel with EasyApache 4 or similar. You may also need to login to your cPanel and go to Software -> MultiPHP INI Editor -> Editor Mode and make the same change there for your domain.

Re: Dev Site Setup, Admin Login Error: Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Sun Mar 17, 2019 3:19 am
by eire
Hi ADD Creative,
Thank you so much, that resolved the issue. It was the multiPHP ini editor as I had already edited the other two .ini files.

Thanks,
Philip

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 4:56 pm
by charlesso
Does it mean that all other parameters in admin/php.ini and client php.ini should remove the semi-colon too?

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 5:25 pm
by IP_CAM
Correct, they should about look like this: (shop php.ini shown below)

Code: Select all

magic_quotes_gpc = Off
register_globals = Off
default_charset	= UTF-8
memory_limit = 640M
max_execution_time = 36000
upload_max_filesize = 999M
safe_mode = Off
mysql.connect_timeout = 20
session.use_only_cookies = On
session.use_trans_sid = Off
session.cookie_httponly = On
session.gc_maxlifetime = 172800
allow_url_fopen = on
;display_errors = 1
;error_reporting = E_ALL

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 5:58 pm
by charlesso
I've been self-hosting OC on PHP 5.6+oc1.5.6.4 for over 7 years, and recently added PHP7.3+oc2.3.0.2, with semi-colon no problem.

Now one of my clients moved to a shared platform, PHP7.3+oc2.3.0.2, with semi-colon no problem.

Only when I add a new client to this shared platform, PHP7.3+oc2.3.0.2, with semi-colon this problem manifest itself!

This shared platform uses cPanel's MultiPHP Manager.... weird.

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 6:02 pm
by IP_CAM
Well, beeing around OC for such a long time, creating income,
you did not seem to be very active at the OC forum, as it looks. Weird .... :laugh:

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 6:46 pm
by ADD Creative
charlesso wrote:
Tue Sep 08, 2020 5:58 pm
I've been self-hosting OC on PHP 5.6+oc1.5.6.4 for over 7 years, and recently added PHP7.3+oc2.3.0.2, with semi-colon no problem.

Now one of my clients moved to a shared platform, PHP7.3+oc2.3.0.2, with semi-colon no problem.

Only when I add a new client to this shared platform, PHP7.3+oc2.3.0.2, with semi-colon this problem manifest itself!

This shared platform uses cPanel's MultiPHP Manager.... weird.

Code: Select all

default_charset	= UTF-8;
Although wrong, will actually work if used in a php.ini file. As PHP will ignore the semicolon.

The problem occurs when cPanel's MultiPHP Manager will process your php.ini and rewrite it along with your user.ini. It will add double quotes which means that PHP will not then ignore the semicolon, which in turn causes the error.

Code: Select all

default_charset	= "UTF-8;"

Re: [SOLVED] Warning: htmlspecialchars(): charset `UTF-8;' not supported

Posted: Tue Sep 08, 2020 7:35 pm
by charlesso
ADD Creative wrote:
Tue Sep 08, 2020 6:46 pm
charlesso wrote:
Tue Sep 08, 2020 5:58 pm
I've been self-hosting OC on PHP 5.6+oc1.5.6.4 for over 7 years, and recently added PHP7.3+oc2.3.0.2, with semi-colon no problem.

Now one of my clients moved to a shared platform, PHP7.3+oc2.3.0.2, with semi-colon no problem.

Only when I add a new client to this shared platform, PHP7.3+oc2.3.0.2, with semi-colon this problem manifest itself!

This shared platform uses cPanel's MultiPHP Manager.... weird.

Code: Select all

default_charset	= UTF-8;
Although wrong, will actually work if used in a php.ini file. As PHP will ignore the semicolon.

The problem occurs when cPanel's MultiPHP Manager will process your php.ini and rewrite it along with your user.ini. It will add double quotes which means that PHP will not then ignore the semicolon, which in turn causes the error.

Code: Select all

default_charset	= "UTF-8;"
Spot on @ADD Creative. I need to update my skills to work on shared platforms. Thanks!