Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 41
  1. #1
    Member
    Join Date
    Sep 2004
    Posts
    523

    Default Disabling PHP for an account or reseller [Case 51859]

    Please add a function to WHM for disabling PHP support to a specific account.

    As we can disable CGI and FrontPage Extensions at the moment of creating an account, it will be wonderfull to have a checkbox deactivate PHP also.

    Thanks a lot!

    Diego

  2. #2
    Member
    Join Date
    Jun 2004
    Posts
    111

    Default

    I also think this would be a good idea


  3. #3
    Member
    Join Date
    Oct 2003
    Posts
    1,020

    Default

    Then you should log it into <<Removed reference to old feature request system>> as an enhancement.

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    215

    Post

    feature needed yes why not

  5. #5
    Member
    Join Date
    Dec 2003
    Posts
    120

    Default

    that would be nice
    but how is it done manualy ? edit each account in httpd.conf and remove php from there ?

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2003
    Posts
    647

    Default

    Change the mime types for the accounts that were to be disabled, make *.php be parsed as *.html...

    That's really the only way I could think of.

  7. #7
    Member
    Join Date
    Jun 2003
    Posts
    280

    Default

    It'll be easy enough for somebody to create a .htaccess of their own with the "proper" PHP settings. You'll also have to disable those directives in the httpd.conf file.

  8. #8
    Member
    Join Date
    Sep 2004
    Posts
    523

    Talking I solved manually!

    I added the following line below DocumentRoot in /scritps/wwwact

    php_flag engine off

    this will turn off PHP when a account is created in whm.

    If you want to give php access to an specific account you must edit httpd.conf and seek for the virtual host you are looking for and delete the php_plag engine off line from it.

    Then restart apache

    Its very simple is cpanel support team add this to the account creation form in WHM with a check box, if its active then add the line. If not, leave php active.


    Enjoy the tip.

    Diego

  9. #9
    Member
    Join Date
    Mar 2004
    Location
    This Planet
    Posts
    984

    Default

    # WWWAcct 9.1 Copyright 1997-2004 cPanel, Inc.
    # Modifing this software without permission is a crime.
    # cpanel9 - scripts Copyright(c) 1997-2004 cPanel, Inc.
    # All rights Reserved.
    # copyright@cpanel.net http://cpanel.net
    # This code is subject to the cpanel license. Unauthorized copying is prohibited
    # exp $needs rewrite$

    I couldn't dare to after reading this

    Anup

  10. #10
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,313
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by bsasninja
    I added the following line below DocumentRoot in /scritps/wwwact
    php_flag engine off this will turn off PHP when a account is created in whm.
    If you want to give php access to an specific account you must edit httpd.conf and seek for the virtual host you are looking for and delete the php_plag engine off line from it.
    Then restart apache
    Its very simple is cpanel support team add this to the account creation form in WHM with a check box, if its active then add the line. If not, leave php active.
    Enjoy the tip. Diego
    Would appreciate a comment from Nick regarding this especially in light of the copyright on this script.

  11. #11
    BANNED
    Join Date
    Feb 2004
    Posts
    349

    Default

    Quote Originally Posted by anup123
    # WWWAcct 9.1 Copyright 1997-2004 cPanel, Inc.
    # Modifing this software without permission is a crime.
    # cpanel9 - scripts Copyright(c) 1997-2004 cPanel, Inc.
    # All rights Reserved.
    # copyright@cpanel.net http://cpanel.net
    # This code is subject to the cpanel license. Unauthorized copying is prohibited
    # exp $needs rewrite$

    I couldn't dare to after reading this

    Anup
    Thats a bloody laugh! Its ok for Cpanel to modify my existing custom installation and break it at times by modifying and updating it, on my own server, for which i pay a license for, but its not ok to modify a script on my box that i may want to customize?

    How does this logic work?

  12. #12
    Member
    Join Date
    Oct 2003
    Posts
    1,020

    Default

    I would assume that a properly licensed cPanel server has permission. I think that the idea with that notice is to prevent someone from grabbing the script wholesale and using it as part of a competing product. They could have compiled it (as they have with other functions) if they really didn't want you touching it.

    Like sawbuck, I would like to hear an official word on this.

  13. #13
    Member
    Join Date
    Sep 2004
    Posts
    523

    Cool ok

    Is a bugzilla opened with this, also i send a mail to technical support yesterday. They told me to add this info in the already opened bugzilla.
    I hope the resolve this fix soon.

  14. #14
    Member
    Join Date
    Dec 2006
    Location
    Istanbul / TURKEY
    Posts
    44
    cPanel/Enkompass Access Level

    Root Administrator

    Cool Disabling PHP for an account or reseller [Case 51859]

    There should be an option to disable php alltogether in the packages for normal accounts and reseller accounts. Resellers shouldn't be able to open new hosts with php.

    This would be a great feature as not everybody uses the cpu killer php apps. Limiting php could drop the price immensely.

  15. #15
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,289
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: Disabling PHP for an account or reseller [Case 51859]

    Hello Datcrack,

    Not to take away from the feature request itself, I did want to mention that PHP can be disabled per account using the following type of entries by putting them as an include in /usr/local/apache/conf/userdata/std/2/$user/$domain.com/ location within a file called $includename.conf (where std represents http VirtualHost section, 2 represents Apache 2 or Apache 2.2, $user represents the cPanel username, $domain.com represents the domain name, and $includename.conf represents the name you choose to call the include configuration file).

    Method 1:

    Code:
    php_value engine off
    Method 2:

    Code:
    RemoveType .php .php4 .php5
    You would put whatever mime types you want to remove in this second method.

    Please note that Method 1 creates blank page for php files. Method 2 creates no mime type so files try to download. You cannot bypass either of these methods in .htaccess file on user's account (AddType is processed before Removetype). Also, AddType in user's .htaccess causes Internal Server Error.

    After creating one of the includes, you'd then need to verify the include, check it into the system, backup Apache, rebuild Apache and restart Apache:

    Code:
    /scripts/verify_vhost_includes
    /scripts/ensure_vhost_includes --user=$username
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110305
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    You can see documentation on using such includes at the following location:

    Changes Contained within a VirtualHost Directive
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Filed with Developers Disabling PHP for an account or reseller [Case 51859]
    By Datcrack in forum Feature Requests for cPanel/WHM
    Replies: 21
    Last Post: 02-17-2012, 02:54 AM
  2. Filed with Developers Reseller Account Backup [Case 49537]
    By Host4cheap in forum Feature Requests for cPanel/WHM
    Replies: 27
    Last Post: 01-06-2012, 02:23 PM
  3. Filed with Developers Assign account owner (reseller) when creating account in WHM [Case 56005]
    By cPanelDavidG in forum Feature Requests for cPanel/WHM
    Replies: 0
    Last Post: 10-13-2011, 02:01 PM
  4. [Case 43541] Include Packages in account backup of reseller (WHM) users
    By cesarlwh in forum Archived Feature Requests
    Replies: 8
    Last Post: 07-14-2011, 10:33 AM
  5. disabling ftp access for an account without disabling account
    By periwinkle in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 10-25-2007, 06:14 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube