ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
Hi to all,
i can't understand what's happening on my server....
Well first time i build my php configuration with easyapache i choose "Php 5.2" and various module for my website.
There was also Ioncube loader installed.
I had a website which was using ioncube and it perfectly opened by itself (loading the default php.ini file).
Last 2 days i started with a new build improving php 5.3.20 and various modules. Website stop to work.....
i had to create a new CUSTOM php.ini for that user and i had to set MANUALLY the path of extension at the TOP of custom php.ini, so website opens again.
I think was just a ioncube directive which need the value BEFORE every possible Zend comment so i figure out issue was that.
Today i discover that on a Joomla site "1.5" php discover some error on timezone (ok i know that). So i check my php and.... IT's THERE! It's showing correctly date.timezone = "Europe/Rome" but is at the end of php.. so it no work!
I cut and copy it on the top of the file and magically errors fly away.
I realized that i have to do this with everything... post filesize, php memory etc... if i leave this value like standard/default php don't work... everytime i have to do a php.ini with value that i prefer on the top of the file, so them works
How is possible?? Is only my issue or really Building action make a php.ini with bad strings?
somebody can help me?
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
cPanel Access Level
Root Administrator
Hi,

My guess is that you are using suPHP, if thats the case you should delete any custom php.ini you have created inside the cpanel account, if you created any custom php.ini for the website the PHP settings will be taken from the custom php.ini and not from the global php.ini config file located in /usr/local/lib/php.ini.
An alternative way would be to copy /usr/local/lib/php.ini file to the custom php.ini you created.
 

ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
Hi,

My guess is that you are using suPHP, if thats the case you should delete any custom php.ini you have created inside the cpanel account, if you created any custom php.ini for the website the PHP settings will be taken from the custom php.ini and not from the global php.ini config file located in /usr/local/lib/php.ini.
An alternative way would be to copy /usr/local/lib/php.ini file to the custom php.ini you created.
Uhmmm ok i can understand that... but i can't realize why also deleting custom php.ini webiste don't keep global phpini default config..
for example as i saied "date.timezone = "Europe/Rome"" is present in the MAIN global php.ini.. but website don't recognize it...
if i delete custom php.ini from website... GLOBAL PHP VALUES NOT WORK.
if i copy php.ini in /public_html/ dir and i set user owner (so like original php) PHP VALUE NOT WORK
if i edit again custom php.ini and put on the top of the file value i need to change.. so it works! It's strange...
This issue could be Suphp option? It's turned on
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
cPanel Access Level
Root Administrator
Hi,

Have you tried adding a phpinfo on the website's public_html folder after removing the custom php.ini? If not, upload one and see which php.ini is loading.

Switing to DSO would probably solve your php.ini issues although you will lose all the suPHP features.
 

ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
Hi,

Have you tried adding a phpinfo on the website's public_html folder after removing the custom php.ini? If not, upload one and see which php.ini is loading.

Switing to DSO would probably solve your php.ini issues although you will lose all the suPHP features.
Well in fact seems that websites are not taking the "global settings" value.
I just tried run phpinfo without any custom php.ini inside /public_html/ dir and directive mismatch with original one.. maybe issue is that.
For example i can see default timezone appear "no value" upload filesize give me "2MB" but it's insane... on the global php.ini it's set to "5MB" :O
How i can switch to DSO? Can you help me?
 

ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
Which php.ini does your PHP info() output say it is using?

You can change your PHP handler in the WebHost Manager by clicking Home » Service Configuration » Configure PHP and suEXEC. This is documented here:

Configure PHP and suEXEC

Ok my phpinfo says:
Configuration File (php.ini) Path /usr/lib
Loaded Configuration File /home/MYUSER/public_html/php.ini

Right now i'm running PHP 5.3.20 handler SUphp and SUEXEC swtich off.
I tried switch to Fast-Cgi.. disaster... Website running Ioncube stop to work with or without custom php.ini
Su i turn again on SuPhp.. something on the server fail to load the global php.ini
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
By default, PHP on cPanel should use the php.ini file in /usr/local/lib, not /usr/lib like you mentioned. However:

Loaded Configuration File /home/MYUSER/public_html/php.ini
That means that it is using the local php.ini file in /home/MYUSER/public_html. I am a little confused, though, because in your next-to-last post you stated:

I just tried run phpinfo without any custom php.ini inside /public_html/ dir and directive mismatch with original one.. maybe issue is that.
What is the setting in /home/MYUSER/public_html/php.ini, and how does it compare to the same setting in /usr/lib/php.ini?

Remember that custom php.ini files only apply to scripts run in the directory where the php.ini file resides. That does not appear to be a problem here, but it is a frequent point of confusion. Custom php.ini files' settings are not "inherited" to subdirectories of the directory where the php.ini file is located.

If you submit a ticket, we can look at this directly for you and probably find the answer fairly quickly.
 

ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
Yes i tried both procedure with custom php.ini and without it
both tests give me wrong value in phpinfo file. I suppose i have something which make conflict on the server in fact i can see (ever in phpinfo page)
Server API = CGI/FastCGI
but how is possible if i'm running SuPhP?
Website are working now but i don't understand why:
-i have to use a custom php.ini for every single website (because they don't keep default php value)
-i have to write my directive at the top of custom php.ini (otherwise not works)
If you think is better i'll open a ticket to understand at well what's happening
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
Server API = CGI/FastCGI
but how is possible if i'm running SuPhP?
That is actually normal. suPHP is reported as CGI in PHP info() output.

The problem you describe is very strange, and offhand I am not certain why it is happening. We would be happy to take a look at it if you submit a ticket.
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
cPanel Access Level
Root Administrator
I tried switch to Fast-Cgi.. disaster... Website running Ioncube stop to work with or without custom php.ini
It should be set to DSO not to FastCGI.

Also, rename /home/MYUSER/public_html/php.ini to /home/MYUSER/public_html/php.ini.bak and refresh the phpinfo page and see if the default php.in is loaded, you may been missing the default php.ini file.
 

ultralion

Well-Known Member
Nov 14, 2012
51
0
6
Viareggio
cPanel Access Level
Root Administrator
It should be set to DSO not to FastCGI.

Also, rename /home/MYUSER/public_html/php.ini to /home/MYUSER/public_html/php.ini.bak and refresh the phpinfo page and see if the default php.in is loaded, you may been missing the default php.ini file.

Done. Nope.. don't change. Default php.ini was not loading. All the global value seems to be wrong (i check every single value from /user/local/lib/php.ini file and are not the same).
I don't know where website are loading the php.info.... so i'll open a ticket now