It is currently Thu Aug 28, 2008 7:57 pm
Moderators: General Support Moderators, Hidden - JSST




Pumuckl wrote:But my Hoster (Schlund) have activated this features and I'm not sure, whether 1and1 this have activated, too.
It's not a failure to do this, if you do not know what your hoster is doing, it's better ti insert your own php.ini-file.
Right?

RobS wrote:Pumuckl wrote:But my Hoster (Schlund) have activated this features and I'm not sure, whether 1and1 this have activated, too.
It's not a failure to do this, if you do not know what your hoster is doing, it's better ti insert your own php.ini-file.
Right?
PHP will not automatically read the vaules from any file called php.ini. PHP has to be configured in the core php.ini file to scan other directories for more ini files. By default, it only scans the extensions directory for other ini files. Some hosts allow the users to override the configuration of the core php.ini via this method but as far as I am aware it is not a very common practice.


I can overide the php.ini file.
Is this a solution that i can use for a more secure Joomla?



albi wrote:Do i need to include php.ini also on images folder???



emagin wrote:I have joomla sites hosted at site5, which runs PHP in cgi mode, supposedly for security.
The default php.ini for the server runs with register_globas=off
To secure your apps, this means that you have to have a php.ini file inside of every directory of your application. This is a major pain, but there is a great solution!
A guy there came up with two great scripts that let you take care of the issue:
1) copy your server's default php.ini - if you don't do this you will cause more damage than doing nothing
2) add the custom features you need in this php.ini
3) copy it across your site with script
http://tips-scripts.com/?tip=php_ini
http://tips-scripts.com/?tip=php_ini_copy
http://tips-scripts.com/?tip=php_ini_delete
I did this after a dotproject app was hacked, and realized how register_globals = ON is dangerous, so i went through all apps to do this. Now I do this as a rule for every app.
So the custom settings would be:
; USER MODIFIED PARAMETERS FOLLOW
register_globals = Off
session.use_trans_sid = 0
And make sure you save CHMOD the php.ini to 0600 before you copy it across the site with the script. (I use winscp to edit the file directly from my desktop, or from putty, not sure if 0600 is too restrictive if you use other methods)




emagin wrote:Also, don't forget to run your copy php.ini script after each component install in Joomla.
There are several components which write data in directories. If there is an exploit of that component (like a forum component, etc.) and you don't run the copy php.ini script to refill those new directories, you could be exposed.


disable_functions = show_source,exec,shell_exec,wget,proc,passthru,system,popen,proc_open,escapeshellcmd,escapeshellarg

register_globals = 0
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
allow_url_fopen = 0
magic_gpc_quotes = 0
silexian wrote:Hello all
i would like your following ini code "translated" into the .htaccess file.
Do you know the equivalence ?
- Code: Select all
register_globals = 0
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
allow_url_fopen = 0
magic_gpc_quotes = 0



You can turn register_globals off by writing the following code (line) in an .htaccess file which is under public_html.
--------------------------------------------------------
php_flag register_globals off
--------------------------------------------------------


This certainly beats using the scripts in this forum to copy a personalized php.ini file in every single directory in my web site.



miggalvez wrote:I asked my hosting server to turn register globals to off and they gave me this answer:You can turn register_globals off by writing the following code (line) in an .htaccess file which is under public_html.
--------------------------------------------------------
php_flag register_globals off
--------------------------------------------------------
Is this true? Does it affect all subdirectories under the public_html directory?


RobS wrote:Actually, that isn't the only decent way. If your host knows what they are doing they can setup Apache/PHP to look for a php file per virtualhost in a specific place. I use this configuration on my own servers and it works very well because it is easier to manage a php.ini file than an .htaccess file in my opinion. The configuration is actually pretty simple but not many hosters implement for some silly reason or another that I would really like to know... anyway, yeah... ask about that option too.
this clarifies it...8)

Users browsing this forum: twcmex and 9 guests