Welcome to the RaGEZONE - MMORPG development forums.

Secure your PHP.INI file!

This is a discussion on Secure your PHP.INI file! within the Habbo Tutorials forums, part of the Habbo Hotel category; Securing your PHP.INI file! 1) display_errors Disable the display_errors is the first thing. If it is ‘ On ‘ the ...

LyncusMU
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300

    Secure your PHP.INI file!

    Tabo Hotel
    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. HostKey.com: Unmetered Dedicated servers in the Netherlands
  3. #2
    Private Detective
    Rank
    Member +
    Join Date
    Aug 2008
    Location
    Greater Manches
    Posts
    714
    Liked
    184

    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.

  4. #3
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300
    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

  5. #4
    No, Just no.
    Rank
    Subscriber
    Join Date
    Jul 2008
    Location
    United Kingdom
    Posts
    1,182
    Liked
    429

    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.

  6. #5
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300

    Re: Secure your PHP.INI file!

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

  7. #6
    Just Dance!
    Rank
    Member +
    Join Date
    Feb 2008
    Posts
    330
    Liked
    1

    Re: Secure your PHP.INI file!

    I actually found this quiet useful. Thanks mate ;)

  8. #7
    Custom User Title
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    地下鉄
    Posts
    2,515
    Liked
    392

    Re: Secure your PHP.INI file!

    But who still uses xampp?
    Posted via Mobile Device

  9. #8
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300

    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.

  10. #9
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,812
    Liked
    1010

    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

  11. #10
    Hi, I'm Omar!
    Rank
    Member +
    Join Date
    Jan 2011
    Location
    Here
    Posts
    1,226
    Liked
    472

    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.

  12. #11
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300

    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

  13. #12
    Iron like Lion in Zion!
    Rank
    Moderator
    Join Date
    Apr 2010
    Location
    Nassau, Bahamas
    Posts
    2,571
    Liked
    573

    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.

  14. #13
    GoldenSRO Lead Developer
    Rank
    Member +
    Join Date
    Dec 2009
    Location
    I R Here ----->
    Posts
    287
    Liked
    56

    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.

  15. #14
    MEHHREKHwhgfkehrkgthregir
    Rank
    Member +
    Join Date
    Sep 2011
    Location
    υηιтє∂
    Posts
    907
    Liked
    300

    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.

  16. #15
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,812
    Liked
    1010

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •