ckh

Well-Known Member
Dec 6, 2003
358
1
168
Phoenix, AZ
cPanel Access Level
DataCenter Provider
I have alt-php installed, 5.4 is the default/native version. Within WHM, php configuration, I have the default_charset set to utf-8

On all the sites using the native php version, phpinfo() shows iso-8859-1 as the default_charset.

It also shows that the loaded configuration file is /usr/local/lib/php.ini which has utf-8 set as the default_charset.

There is no custom php.ini file being used.

I can't figure out why it won't take utf-8 as the charset, not sure if it's related to alt-php or not.
 

someB0dy

Member
May 24, 2010
22
2
53
cPanel Access Level
Root Administrator
Just checked and default_cahrset is really applied and are shown in phpinfo() page. Where are you changing default_charset?

Suppose in /usr/local/lib/php.ini , while doing this in /opt/alt/php54/etc/php.ini would make it working like supposed to be.
 

ckh

Well-Known Member
Dec 6, 2003
358
1
168
Phoenix, AZ
cPanel Access Level
DataCenter Provider
Well, I'd change it within whm and the /usr/local/lib/php.ini file is updated.

I believe the options in the /opt/alt/php?? directory is if a version is selected other than native and the /usr/local/lib/php.ini file is used if the user is using the version compiled into apache or native. But, I had tried changing the one in the opt/alt/php54 directory and that didn't do any either.
 

ckh

Well-Known Member
Dec 6, 2003
358
1
168
Phoenix, AZ
cPanel Access Level
DataCenter Provider
It wasn't a custom php.ini option. It was using the native php, which is 5.4. For some reason it is showing utf-8 as the charset today with no changes made. There must be some caching or something going on. Normally the results are instantaneous.

I have CL set up on about 5 or so servers this way and hadn't seen this before. The native changes had always been instantaneous when I made the modification in WHM. Actually, the custom changes had been instantaneous also.

Seems good to go now, maybe when the upcp ran it updated everything.

I had the primary drive fail on this server and reinstalled everything a couple days ago.
 

vipoint

Registered
Mar 10, 2014
4
0
1
cPanel Access Level
Root Administrator
The alt-php versions encoding can be changed in /opt/alt/php54/etc/php.ini.

You can change the default_charset for an user in /etc/cl.selector/php.conf.

The directives can be added as follows.

Directive = default_charset
Default = iso-8859-1
Range = utf-8,iso-8859-1
Type = list

The user can change this option via control panel in item PHP Settings. Also this can be changed via piniset utility through commandline as follows.

/usr/bin/piniset --replace="default_charset:utf-8" --version=5.3 --user=username