Morley

Well-Known Member
Apr 24, 2007
66
0
156
I recompiled using EA3 again because I wanted to add GD support for PHP. Now users get a file download for ANY php file.

How do I stop this?

Available handlers: suphp dso cgi none
PHP4 SAPI: not installed
PHP5 SAPI: not installed
SUEXEC: available

How do I add the handlers?

Thanks
 
Last edited:

namehog

Active Member
Aug 7, 2003
32
0
156
Northampton UK
PHP handlers

When you rebuild PHP - then select PHP4 and PHP5 and also add CGI - when the build is complete - select either PHP4 or PHP5 as the default and then set PHP4 to DSO and PHP5 to CGI - ( it is not clear in notes about this but works )
 

Morley

Well-Known Member
Apr 24, 2007
66
0
156
When you rebuild PHP - then select PHP4 and PHP5 and also add CGI - when the build is complete - select either PHP4 or PHP5 as the default and then set PHP4 to DSO and PHP5 to CGI - ( it is not clear in notes about this but works )
My problem was I was not seeing anything in the WHM Main >> Service Configuration >> Configure PHP and SuExec so there was nothing to choose.

An error log stated a problem starting IONCUBE so I built again and removed that then there was: SUPHP, DSO, CGI and NONE. I selected suPHP and that solved the downloading php files.

Should I have chosen CGI? Is there a problem with IONCUBE?

Thanks
 

utropic

Well-Known Member
Aug 6, 2005
60
0
156
we just ran ea3 with php5 selected and all the php is now broken. browsers are asking the clients to "save as" when they visit a php page. Was there any update on this issue? It's kind of a biggie.
 

jpetersen

Well-Known Member
Dec 31, 2006
113
4
168
we just ran ea3 with php5 selected and all the php is now broken. browsers are asking the clients to "save as" when they visit a php page. Was there any update on this issue? It's kind of a biggie.
Are your handlers set up properly for the version(s) of PHP that you are using? You can view the current settings with this command:

Code:
[b]# /usr/local/cpanel/bin/rebuild_phpconf --current[/b]
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
If you run the command without any options, you can view the usage:

Code:
# /usr/local/cpanel/bin/rebuild_phpconf
[b]Usage: /usr/local/cpanel/bin/rebuild_phpconf [--dryrun] [--no-restart] [--no-user-updates] [--current|--available] <Default PHP> <PHP4 Handler> <PHP5 Handler> <Suexec>[/b]
 --dryrun       : Only display the changes that would be made
 --no-restart   : Don't restart Apache after updating the php.conf link
 --no-htaccess  : Don't update user configurable PHP mime mapping.
 --current      : Show current settings
 --available    : Show available handlers and PHP SAPIs
 <Default PHP>  : Version of PHP to set as default handler for .php files
 <PHP# Handler> : Type of Apache module to use in serving PHP requests
 <Suexec>       : enabled, disabled, 1 or 0

This command would set the default PHP version to 5, not set any handlers for PHP 4, set the suPHP handler for PHP, and enable suexec:

Code:
# /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
 
Last edited:

mydomain

Well-Known Member
Aug 10, 2003
138
0
166
How did you fix this, have same problem on one server and when run:

/usr/local/cpanel/bin/rebuild_phpconf 5 none dso 1

it gives the following "error":

Invalid combination.
PHP5 is not available. Please rebuild apache if you require this configuration.
Ive selected the latest PHP5 and used a previous build file which was working fine so dont know why this is giving the error?

Please help !!
 

utropic

Well-Known Member
Aug 6, 2005
60
0
156
How did you fix this, have same problem on one server and when run:

/usr/local/cpanel/bin/rebuild_phpconf 5 none dso 1

it gives the following "error":



Ive selected the latest PHP5 and used a previous build file which was working fine so dont know why this is giving the error?

Please help !!

Even if you're just going to use php5, rebuild it and select php4 AND php5. I think there is a bug in ea3 that requires this.

Also don't select the Ioncube loaders.
 

nerbonne

Well-Known Member
Aug 19, 2007
52
1
58
Code:
# /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
Thanks for this command. It gave me a very informative error. Based upon this output and previous problems with Ioncube, I unchecked Ioncube and re-compiled and it worked fine. Error output:

[email protected] [~]# /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
Invalid combination.
PHP5 is not available. Please rebuild apache if you require this configuration.

@ Cpanel: Please fix the Ioncube breaking PHP problem. This has happened on TWO brand new servers now.


Edit: this may be related to using PHP 5.2.8 because it worked with PHP 5.2.6
 
Last edited:

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
i have the same problem though i didnt try this to php 5.2.6

i cant disable ioncube loaders because i use them for fantastico