PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5.4.4

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Could you also try bumping it to unlimited then in WHM > Tweak Settings > Max cPanel Process Memory? If that still doesn't work, please check /usr/local/cpanel/logs/error_log when loading WHM > Apache Configuration > PHP and SuExec Configuration area. If you do not see errors, please try running the update in command line. First, check the current settings:

Code:
/usr/local/cpanel/bin/rebuild_phpconf --current
After that, set it using this type of example:

Code:
/usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
The above represents 5 as PHP 5 being default handler, none for PHP 4, suphp for PHP 5 hanlder, and 1 for suEXEC being enabled. If you want a different handler for PHP 5 than suphp, enter either dso or fcgi there instead.
 

Brunomiova

Registered
Jul 13, 2012
2
0
1
Arapiraca, Brazil
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Code:
/usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
The above represents 5 as PHP 5 being default handler, none for PHP 4, suphp for PHP 5 hanlder, and 1 for suEXEC being enabled. If you want a different handler for PHP 5 than suphp, enter either dso or fcgi there instead.
Returning: "Invalid combination. PHP5 is not available. Please rebuild apache if you require this configuration."

and after the upgrade:

Code:
[B]/usr/local/cpanel/bin/rebuild_phpconf --current[/B]

Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: none
SUEXEC: enabled
RUID2: not installed
 

brasoveanul

Member
May 9, 2010
10
0
51
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

The error in the log refers to the directive magic_quotes_gpc, which is unsupported. What file should I edit? I use suphp.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Please post the full error from the log and which log you are seeing the error in specifically.
 

brasoveanul

Member
May 9, 2010
10
0
51
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

The error log is located at /usr/local/cpanel/logs/error_log . The message is the following, and there are several identical messages in the log, one after the other:

<b>Fatal error</b>: Directive 'magic_quotes_gpc' is no longer available in PHP in <b>Unknown</b> on line <b>0</b><br />
at /usr/local/cpanel/Cpanel/PHPINI.pm line 73
Cpanel::PHPINI::check_installed_php_binaries() called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 489
Cpanel::PHPConfig::_get_partial_advconfig_conf() called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 169
Cpanel::PHPConfig::configure_php(HASH(0xa44d6d0)) called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 143
Cpanel::PHPConfig::setup_default_phpconf(HASH(0xa3ec01c)) called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/PHP.pm line 232
Cpanel::Easy::Utils::PHP::setup_php_include(Cpanel::Easy::Apache=HASH(0x9809e2c)) called at /var/cpanel/perl/easy/Cpanel/Easy/Uti$
Cpanel::Easy::Utils::HttpdConf::_generate_config(Cpanel::Easy::Apache=HASH(0x9809e2c)) called at /var/cpanel/perl/easy/Cpanel/Eas$
Cpanel::Easy::Utils::HttpdConf::post_httpd_conf_handler(Cpanel::Easy::Apache=HASH(0x9809e2c)) called at /var/cpanel/perl/easy/Cpa$
Cpanel::Easy::Apache::UI::HTML::cleanup(Cpanel::Easy::Apache::UI::HTML=HASH(0x9813814), Cpanel::Easy::Apache=HASH(0x9809e2c)) cal$
Cpanel::Easy::cleanup(Cpanel::Easy::Apache=HASH(0x9809e2c)) called at /var/cpanel/perl/easy/Cpanel/Easy.pm line 1003
Cpanel::Easy::install_profile(Cpanel::Easy::Apache=HASH(0x9809e2c), undef, undef) called at /var/cpanel/perl/easy/Cpanel/Easy/Apa$
Cpanel::Easy::Apache::install_profile(Cpanel::Easy::Apache=HASH(0x9809e2c), undef) called at /var/cpanel/perl/easy/Cpanel/Easy/Ut$
Cpanel::Easy::Utils::BackGround::__ANON__(Cpanel::Easy::Apache=HASH(0x9809e2c), undef, '/tmp/.cpanel_easy-.BftCymizO9TiUas5') cal$
Acme::Spork::spork(CODE(0x9060628), Cpanel::Easy::Apache=HASH(0x9809e2c), undef, '/tmp/.cpanel_easy-.BftCymizO9TiUas5') called at$
Cpanel::Easy::Utils::BackGround::run_install_in_bg(Cpanel::Easy::Apache=HASH(0x9809e2c), undef) called at /var/cpanel/perl/easy/C$
Cpanel::Easy::Apache::UI::HTML::install_profile(Cpanel::Easy::Apache::UI::HTML=HASH(0x9813814), Cpanel::Easy::Apache=HASH(0x9809e$
Cpanel::Easy::run(Cpanel::Easy::Apache=HASH(0x9809e2c)) called at /usr/local/cpanel/whostmgr/docroot/cgi/easyapache.pl line 81
[2012-07-15 20:38:44 +0300] info [apache_conf_distiller] 'local' datastore in use (/var/cpanel/conf/apache/local)
[2012-07-15 20:38:44 +0300] info [easyapache] 'local' datastore in use (/var/cpanel/conf/apache/local)
[2012-07-15 20:38:55 +0300] warn [Cpanel::PHPINI] Unexpected output from /usr/bin/php -v : <br />
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

If you run "php -v" without the quotes in command line, does it show the same error or a different one?

I'm right now trying to update my test machine to PHP 5.4 to see the results. That might take 30 minutes, so please stand by.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

All right, so magic_quotes_gpc didn't compile on my machine with PHP 5.4, but it might be because I didn't previously have it selected. Please submit a ticket. I've just heard that if you select an MPM other than Prefork with PHP 5.4 that you might also have issues. We have an internal case about the magic quotes issue already (case 60278), but the ticket I've seen on the issue tried copying the PHP handler portion from another server's /usr/local/apache/conf/php.conf and that's not the ideal way to handle this. We'd need to see if we can get the handler to populate by possibly recompiling EasyApache to specifically remove magic quotes by using a custom build.

A ticket can be submitted in WHM > Support Center > Contact cPanel or using the link in my signature. Please post the ticket number here afterward. I'm going to try to get to the ticket myself, since I'd like to investigate what is happening here (if it doesn't end up being magic quotes).
 

brasoveanul

Member
May 9, 2010
10
0
51
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Hello, I submitted the ticket, the request ID is 2921678 .
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Of note, we found in the ticket that suhosin was the issue. EasyApache no longer allows PHP 5.4 + Suhosin to be compiled together. We have an internal case for /scripts/phpextensionmgr to prevent installation of suhosin there (that is case 2921678).
 

brasoveanul

Member
May 9, 2010
10
0
51
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Doesn't this pose a security threat to the apache+php system, its compilation without suhosin?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

How precisely can we add support for SuHosin with PHP 5.4 when SuHosin themselves do not yet support PHP 5.4?

Whether it reduces security in any way, PHP 5.4 is labelled as experimental during EasyApache. These are the risks being taken by users when they select experimental options.

Thanks!
 

brasoveanul

Member
May 9, 2010
10
0
51
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

I understand and agree, but I was just asking, could this pose a security threat, so that it would be advisable to defer upgrading to php 5.4 at this time? Is suhosin important, security-wise and in the context of php 5.4? Maybe php 5.4 contains some built-in security features?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Unfortunately, I'm not aware of suhosin replacement options in PHP 5.4, although it's possible that these exist and I'm simply not finding any details. I believe the main reason it isn't yet compatible is that the developer of suhosin has been working on updating for PHP 5.4 for awhile and hasn't yet completed the process.
 

sardelich

Well-Known Member
Apr 28, 2010
72
1
58
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

hm.I just did a fresh install of centos 6.3 x64 and latest release of cpanel.Tried compiling easyapache with php 5.4 and no luck,same errors as above,but now i still cant get it compiled wioth php 5.3.14.Now I'm trying with suhosin off,but still I want php 5.3.14 compiled,and after 3 attempts still no luck :/
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: PHP Handler: None and Default PHP Version (.php files) is empty - PHP 5

Is the PHP handler dropdown empty as well? If so, try increasing WHM > Tweak Settings > Max cPanel Process Memory to 512 or unlimited to see the results. If the handler is empty under PHP 5.3, it is almost always due to that max memory setting.
 

LAZer

Well-Known Member
Jan 18, 2010
78
2
58
at net :D
i have upgraded my php from 5.3 to 5.4 for 2 or 3 times during previous monthes , but i always faced the same problem , there is no php handler for php 5.4 in whm , and memory is set to unlimited in tweak setting.
today i finally could solve it . i must rebuild php.ini configuration with removing safe_mode codes from it , and also some eaccelerator config lines. then saved the php.ini via whm php configuration editor again . ( it updates this file : /usr/local/lib/php.ini )
then i could manually update apache php handler :
/usr/local/cpanel/bin/rebuild_phpconf --current
/usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
and now php -v works.



these are eaccelerator configs that generated error :

null user passed to hulk.pm can_login: info: Cpanel::Hulk
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive directive
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive foo
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive foo
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive foo
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive lpath_cache_size
[2013-08-13[whostmgr] Skipping unknown PHP ini directive gpc_order
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.cache_dir
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.check_mtime
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.compress
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.compress_level
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.debug
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.enable
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.filter
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.optimizer
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.shm_max
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.shm_only
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.shm_prune_period
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.shm_size
[2013-08-13] info [whostmgr] Skipping unknown PHP ini directive eaccelerator.shm_ttl
and also disabled magic_quotes as it produce errors in wordpress sites.

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
; magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
; magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
; magic_quotes_sybase = Off

these are the errors when easy apache completed installation process :
vim /usr/local/cpanel/logs/error_log +
[2013-08-13 ] warn [Cpanel::PHPINI] Unexpected output from /usr/bin/php -v : at /usr/local/cpanel/Cpanel/PHPINI.pm line 73
Cpanel::PHPINI::check_installed_php_binaries() called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 489
Cpanel::PHPConfig::_get_partial_advconfig_conf() called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 169
Cpanel::PHPConfig::configure_php(HASH(0xaf22160)) called at /usr/local/cpanel/Cpanel/PHPConfig.pm line 143
Cpanel::PHPConfig::setup_default_phpconf(HASH(0xa9fe8f0)) called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/PHP.pm line 256
Cpanel::Easy::Utils::PHP::setup_php_include(Cpanel::Easy::Apache=HASH(0x7f87878)) called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/HttpdConf.pm line 561
Cpanel::Easy::Utils::HttpdConf::_generate_config(Cpanel::Easy::Apache=HASH(0x7f87878)) called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/HttpdConf.pm line 866
Cpanel::Easy::Utils::HttpdConf::post_httpd_conf_handler(Cpanel::Easy::Apache=HASH(0x7f87878)) called at /var/cpanel/perl/easy/Cpanel/Easy/Apache/UI/CLI.pm line 318
Cpanel::Easy::Apache::UI::CLI::cleanup(Cpanel::Easy::Apache::UI::CLI=HASH(0xa049390), Cpanel::Easy::Apache=HASH(0x7f87878)) called at /var/cpanel/perl/easy/Cpanel/Easy.pm line 1355
Cpanel::Easy::cleanup(Cpanel::Easy::Apache=HASH(0x7f87878)) called at /var/cpanel/perl/easy/Cpanel/Easy.pm line 1033
Cpanel::Easy::install_profile(Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml', undef) called at /var/cpanel/perl/easy/Cpanel/Easy/Apache.pm line 1010
Cpanel::Easy::Apache::install_profile(Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml') called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/BackGround.pm line 56
Cpanel::Easy::Utils::BackGround::__ANON__(Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml', '/tmp/.cpanel_easy-.DsAhvBOcYx2jkFU7') called at /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Acme/Spork.pm line 85
Acme::Spork::spork(CODE(0x85e30f0), Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml', '/tmp/.cpanel_easy-.DsAhvBOcYx2jkFU7') called at /var/cpanel/perl/easy/Cpanel/Easy/Utils/BackGround.pm line 67
Cpanel::Easy::Utils::BackGround::run_install_in_bg(Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml') called at /var/cpanel/perl/easy/Cpanel/Easy/Apache/UI/CLI.pm line 420
Cpanel::Easy::Apache::UI::CLI::install_profile(Cpanel::Easy::Apache::UI::CLI=HASH(0xa049390), Cpanel::Easy::Apache=HASH(0x7f87878), '/var/cpanel/easy/apache/profile/_main.yaml') called at /var/cpanel/perl/easy/Cpanel/Easy.pm line 259
Cpanel::Easy::run(Cpanel::Easy::Apache=HASH(0x7f87878)) called at /scripts/easyapache line 40

and now the working php :
php -v
PHP 5.4.17 (cli) (built: Aug 13 2013 00:34:37)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.
it is in suphp mode , but it doesnt have safe_mode , magic_quotes and suhossin .
 
Last edited: