Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member linuxprovider's Avatar
    Join Date
    Mar 2004
    Location
    egypt
    Posts
    28

    Angry Securing php

    Dear All

    I have Securing my php by make safe mode on and disable some functions

    but now am facing annoying things from my customers as they create a php.ini
    on there sites and enable what they wish like make safe mode off

    plz How could i stop that
    make this file (php.ini) useless on there sites
    Shafei Gad
    Linux System Administrator
    002 0123802231


  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    IIRC, if you install Zend Optimizer local php.ini files are ignored:

    /scripts/installzendopt
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member linuxprovider's Avatar
    Join Date
    Mar 2004
    Location
    egypt
    Posts
    28

    Default

    Dear chirpy

    I have allready installed Zend opt
    And am running php as cgi ( phpsuexec )

    and my customers still can disable safe mode
    Shafei Gad
    Linux System Administrator
    002 0123802231


  4. #4
    Member
    Join Date
    Sep 2006
    Posts
    48

    Default

    Hi,
    In there vHost add php_admin_value safe_mode on and they cant turn it off

  5. #5
    Member linuxprovider's Avatar
    Join Date
    Mar 2004
    Location
    egypt
    Posts
    28

    Default

    Thanks

    But am runnig php as cgi (phpsuexec)


    so i can not add php_admin_value at httpd.conf
    Shafei Gad
    Linux System Administrator
    002 0123802231


  6. #6
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Quote Originally Posted by linuxprovider View Post
    Dear All

    I have Securing my php by make safe mode on and disable some functions

    but now am facing annoying things from my customers as they create a php.ini
    on there sites and enable what they wish like make safe mode off

    plz How could i stop that
    make this file (php.ini) useless on there sites
    I personally don't recommend phpSuExec because of reasons like this and
    also that it creates more security risks than those it is supposed to fix.

    I do, however, very strongly recommend SuPHP as it gives you all the benefits
    of phpSuExec without any of the negatives (performance, security, etc).

    Under EDGE with Apache 2, SuPHP can be installed automatically

    Under all other trees with Apache 1.x, SuPHP would have to be installed
    manually by hand since it's not currently directly supported by Cpanel
    for Apache 1.x even though the latest release of SuPHP supports
    the earlier versions of Apache.

    Now with that said, there are a few things that can be done to improve
    the situation with phpSuExec:

    1. Install Zend Optimizer (/scripts/installzendopt 3.2.6)

    2. Make sure your PHP is at least PHP 5.1.6 minimum and I strongly
    recommend using PHP 5.2.1 as this will directly remove the
    custom php.ini ability of the users.

    3. Install SuHosin patch and / or extension

    4. If you want to get really slick on your users, you can setup a cron job
    to search for and remove custom php.ini files at regular intervals
    (Basic example: find /home/*/public_html -type 'f' -name 'php.ini' -print | xargs rm -f)

    I am not a very big fan of "safe mode" though because there is a
    number of weaknesses with that which are pretty well known and it is
    usually better to custom configure the security of all the relevant areas
    such as disable dynamic load modules, enable openbase restrictions,
    lock down dangerous functions with disable_functions, etc

Similar Threads & Tags
Similar threads

  1. Hotlink protection: securing PHP-generated images
    By Kelmas in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-02-2008, 12:49 PM
  2. Securing/Hardening PHP
    By sh4ka in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-18-2005, 08:50 AM
  3. Securing Email
    By salvatore333 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-04-2004, 12:01 PM
  4. Suggestion on securing a PHP file.
    By wills in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-31-2003, 06:11 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube