Secure your PHP.INI file!

Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Secure your PHP.INI file!

    Securing your PHP.INI file!


    1) display_errors
    Disable the display_errors is the first thing. If it is ‘ On ‘ the errors on execution will be displayed to the user’s browser window. So the user can get an idea about the table structure and directory structure. You can avoid this by disabling display_errors in php.ini
    Usage : display_errors=OFF


    2) safe_mode
    safe_mode is more relevent in a shared server environment. If safe_mode is enabled it will check a UID/GID comparison check on the file/directory to be accessed and compare it to the uid/gid of the script that is trying to access the file. If that are same it will allow the file access if not it will block the access. If you want to compare only GID then you can enable ” safe_mode_gid” value in php.ini .


    3) sql.safe_mode
    Make sql.safe_mode as Off. If it is on mysqli_connect() and mysql_connect() will connect to mysql with default username and password.


    4) magic_quotes_gpc
    Enable magic_quotes_gpc so that you can make your user inputs secure. It work s same as addslashes() function. It will add a backslash () with every single quotes, double quotes.


    5) safe_mode_allowed_env_vars and safe_mode_allowed_env_vars
    These two variables will protect environment variables from changing using user php scripts. The field safe_mode_allowed_env_vars contains a list of prefixes that identify the names of the environment variables the user is allowed to change. So that environment variables which are not starting with one of them defined in safe_mode_allowed_env_vars cannot be modified.
    Another configuration safe_mode_protected_env_vars will set the names of environment variables that the user is not allowed to modify even if it is present in safe_mode_allowed_env_vars.


    6) disable_functions
    This will allow you to disable the insecure functions such as shell_exec, system,exec.

    This information was taken from: Secure Your PHP Scripts


  2. #2
    Account Upgraded | Title Enabled! Predict is offline
    MemberRank
    Aug 2008 Join Date
    760Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Jupos View Post
    Securing your PHP.INI file!


    1) display_errors
    Disable the display_errors is the first thing. If it is ‘ On ‘ the errors on execution will be displayed to the user’s browser window. So the user can get an idea about the table structure and directory structure. You can avoid this by disabling display_errors in php.ini
    Usage : display_errors=OFF


    2) safe_mode
    safe_mode is more relevent in a shared server environment. If safe_mode is enabled it will check a UID/GID comparison check on the file/directory to be accessed and compare it to the uid/gid of the script that is trying to access the file. If that are same it will allow the file access if not it will block the access. If you want to compare only GID then you can enable ” safe_mode_gid” value in php.ini .


    3) sql.safe_mode
    Make sql.safe_mode as Off. If it is on mysqli_connect() and mysql_connect() will connect to mysql with default username and password.


    4) magic_quotes_gpc
    Enable magic_quotes_gpc so that you can make your user inputs secure. It work s same as addslashes() function. It will add a backslash () with every single quotes, double quotes.


    5) safe_mode_allowed_env_vars and safe_mode_allowed_env_vars
    These two variables will protect environment variables from changing using user php scripts. The field safe_mode_allowed_env_vars contains a list of prefixes that identify the names of the environment variables the user is allowed to change. So that environment variables which are not starting with one of them defined in safe_mode_allowed_env_vars cannot be modified.
    Another configuration safe_mode_protected_env_vars will set the names of environment variables that the user is not allowed to modify even if it is present in safe_mode_allowed_env_vars.


    6) disable_functions
    This will allow you to disable the insecure functions such as shell_exec, system,exec.

    This information was taken from: Secure Your PHP Scripts
    Somebody has been reading my posts.
    P.S: This is related to Xampp.

  3. #3
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts
    Quote Originally Posted by Predict View Post
    Somebody has been reading my posts.
    P.S: This is related to Xampp.
    Why quote the main thread? XD
    Posted via Mobile Device

  4. #4
    No, Just no. Matthew is offline
    MemberRank
    Jul 2008 Join Date
    United KingdomLocation
    1,408Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Jupos View Post
    1) display_errors
    Disable the display_errors is the first thing. If it is ‘ On ‘ the errors on execution will be displayed to the user’s browser window. So the user can get an idea about the table structure and directory structure. You can avoid this by disabling display_errors in php.ini
    Usage : display_errors=OFF
    Not really a big issue. If you're running a production website that's visible on the internet your CMS shouldn't have errors. Period.

    Quote Originally Posted by Jupos View Post
    2) safe_mode
    safe_mode is more relevent in a shared server environment. If safe_mode is enabled it will check a UID/GID comparison check on the file/directory to be accessed and compare it to the uid/gid of the script that is trying to access the file. If that are same it will allow the file access if not it will block the access. If you want to compare only GID then you can enable ” safe_mode_gid” value in php.ini .
    This is old, very old. Safe_mode is completely removed in later PHP builds. And even in the older ones it's caused more problems than its attempted to solve. Hence PHP removing it.
    Quote Originally Posted by Jupos View Post
    3) sql.safe_mode
    Make sql.safe_mode as Off. If it is on mysqli_connect() and mysql_connect() will connect to mysql with default username and password.
    Same as above. Removed, if not useless.
    Quote Originally Posted by Jupos View Post
    4) magic_quotes_gpc
    Enable magic_quotes_gpc so that you can make your user inputs secure. It work s same as addslashes() function. It will add a backslash () with every single quotes, double quotes.
    Same as above, being removed. magic_quotes as made for noobs in the early days as a way of combating SQL injections.

    Quote Originally Posted by Jupos View Post
    5) safe_mode_allowed_env_vars and safe_mode_allowed_env_vars
    These two variables will protect environment variables from changing using user php scripts. The field safe_mode_allowed_env_vars contains a list of prefixes that identify the names of the environment variables the user is allowed to change. So that environment variables which are not starting with one of them defined in safe_mode_allowed_env_vars cannot be modified.
    Another configuration safe_mode_protected_env_vars will set the names of environment variables that the user is not allowed to modify even if it is present in safe_mode_allowed_env_vars.
    Never really heard of these, again I doubt these are even in PHP builds any more.

    Quote Originally Posted by Jupos View Post
    6) disable_functions
    This will allow you to disable the insecure functions such as shell_exec, system,exec.
    Now, I'm not flaming you. But I'm just stating what appears to be the facts. Also note the article date: "April 21st, 2007". Most if not everything on that article does not relate to later PHP builds and is obsolete.

    Thanks for trying though.

  5. #5
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Secure your PHP.INI file!

    Im just trying to help Habbo community, thanks for your input!
    Posted via Mobile Device

  6. #6
    Account Upgraded | Title Enabled! dance.it is offline
    MemberRank
    Feb 2008 Join Date
    329Posts

    Re: Secure your PHP.INI file!

    I actually found this quiet useful. Thanks mate ;)

  7. #7
    sexiess is a sin. Subway is offline
    MemberRank
    Jun 2010 Join Date
    2,491Posts

    Re: Secure your PHP.INI file!

    But who still uses xampp?
    Posted via Mobile Device

  8. #8
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Subway View Post
    But who still uses xampp?
    Posted via Mobile Device
    This applies to everyone using PHP. IIS uses PHP, nginx uses PHP etc.

  9. #9
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Subway View Post
    But who still uses xampp?
    Posted via Mobile Device
    xampp is a pack with php, mysql, apache etc in a handy installer.

    x.x, But who did know that

  10. #10
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: Secure your PHP.INI file!

    I recommend AppServ honestly, it's PHP.ini is quite secure without even a single edit, and the fact that xampp has that webdav exploit(I know it takes 2 clicks to patch it but still) makes me hate xampp.

  11. #11
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Vusion View Post
    I recommend AppServ honestly, it's PHP.ini is quite secure without even a single edit, and the fact that xampp has that webdav exploit(I know it takes 2 clicks to patch it but still) makes me hate xampp.
    I use my owner Private Webserver, BrainServer. It's a mix of nginx, PHP, MySQL. Might be releasing it when it's finished. ;3

  12. #12
    Iron like a Lion in Zion! vLife is offline
    Super ModRank
    Apr 2009 Join Date
    The BahamasLocation
    3,788Posts

    Re: Secure your PHP.INI file!

    XAMPP is used for people who develop. That's its whole purpose of it.
    Was never meant to be used to run Private Servers on it.

  13. #13
    Gamma Project Extranautus evilxeddie is offline
    MemberRank
    Dec 2009 Join Date
    SeattleLocation
    363Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Jupos View Post
    Securing your PHP.INI file!


    1) display_errors
    Disable the display_errors is the first thing. If it is ‘ On ‘ the errors on execution will be displayed to the user’s browser window. So the user can get an idea about the table structure and directory structure. You can avoid this by disabling display_errors in php.ini
    Usage : display_errors=OFF


    2) safe_mode
    safe_mode is more relevent in a shared server environment. If safe_mode is enabled it will check a UID/GID comparison check on the file/directory to be accessed and compare it to the uid/gid of the script that is trying to access the file. If that are same it will allow the file access if not it will block the access. If you want to compare only GID then you can enable ” safe_mode_gid” value in php.ini .


    3) sql.safe_mode
    Make sql.safe_mode as Off. If it is on mysqli_connect() and mysql_connect() will connect to mysql with default username and password.


    4) magic_quotes_gpc
    Enable magic_quotes_gpc so that you can make your user inputs secure. It work s same as addslashes() function. It will add a backslash () with every single quotes, double quotes.


    5) safe_mode_allowed_env_vars and safe_mode_allowed_env_vars
    These two variables will protect environment variables from changing using user php scripts. The field safe_mode_allowed_env_vars contains a list of prefixes that identify the names of the environment variables the user is allowed to change. So that environment variables which are not starting with one of them defined in safe_mode_allowed_env_vars cannot be modified.
    Another configuration safe_mode_protected_env_vars will set the names of environment variables that the user is not allowed to modify even if it is present in safe_mode_allowed_env_vars.


    6) disable_functions
    This will allow you to disable the insecure functions such as shell_exec, system,exec.

    This information was taken from: Secure Your PHP Scripts


    This is win.....nice work


    Mind if I link this in the Silkroad Section?(With you in the credits ofc) VSRO is huge and based strictly on an IIS Billing system. This is a must have and must know for the Silkroad Community.

  14. #14
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by evilxeddie View Post
    This is win.....nice work


    Mind if I link this in the Silkroad Section?(With you in the credits ofc) VSRO is huge and based strictly on an IIS Billing system. This is a must have and must know for the Silkroad Community.
    Sure, this thread is designed to help people.

    Quote Originally Posted by RetroX View Post
    XAMPP is used for people who develop. That's its whole purpose of it.
    Was never meant to be used to run Private Servers on it.
    this.

  15. #15
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Secure your PHP.INI file!

    Quote Originally Posted by Jupos View Post
    I use my owner Private Webserver, BrainServer. It's a mix of nginx, PHP, MySQL. Might be releasing it when it's finished. ;3
    Lol'd, PHP and MySQL are stand-alone services x]

    The webserver has nothing to-do with it.
    It only execute it when needed.



Page 1 of 2 12 LastLast

Advertisement