Joomla! Discussion Forums



It is currently Thu Nov 26, 2009 2:02 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Creating custom PHP.ini
Posted: Sun Sep 17, 2006 9:55 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 25, 2006 10:56 pm
Posts: 39
I am trying to use the instructions here:  http://forum.joomla.org/index.php/topic ... html&nbsp; as well as here:  http://tips-scripts.com/?tip=php_ini#tip&nbsp; to create a custom php.ini file and then copy it to each subdirectory.  I haven't got to the copy part yet.  I keep getting these warnings when i try to run the createini.php script:

Warning: fopen(PATH TO CUSTOM LOCATION FOR MY PHP.INI): failed to open stream: Permission denied in PATH TO MY CREATEINI.PHP FILE on line 22

Warning: fwrite(): supplied argument is not a valid stream resource in PATH TO MY CREATEINI.PHP FILE on line 23
Processing error - php.ini write failed

Any ideas how to fix this.

What I am really trying to do is fix the backend Warning message I am getting (after patching to 1.0.11):

PHP register_globals setting is `ON` instead of `OFF`
Joomla! RG_EMULATION setting is `ON` instead of `OFF` in file globals.php


Top
  E-mail  
 
Posted: Mon Sep 18, 2006 12:43 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Mon Jun 19, 2006 5:54 pm
Posts: 313
If the goal is to turn off RG emulation (thereby clearing the backend message and providing more robust security for your site), you can simply edit global.php and change the RG emulation value..

http://forum.joomla.org/index.php/topic,93640.0.html
(see RG Emulation section -- which is different from php's own register_globals variable).

However, this does not address the larger question of whether or not php's register_global flag is on or off on your site. You can review Joomla's php info (backend... System - > System Info - > PHP Info) and check the variables value.

Emulation is left on by default in order to prevent unexpected failures in poorly written 3rd party modules. However, the recommended best practice is to turn both php's register_globals variable AND Joomla's RG emulation off, thereby eliminating any register_globals-based exploits

If register_globals is off, turning off Joomla's RG emulation will harden your site against some forms of exploits. However, turning off RG emulation won't help if register_globals is on. To change register_globals, your best bet would be to add a php directive in your .htaccess file. (See the link above for information on that as well).  Trying to create individual php.ini is, IMHO, more of a last-resort option, as it's very sensitive to how the host has deployed php and can lead to confusion in terms of managing default values.


Last edited by zman818 on Mon Sep 18, 2006 1:02 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Thu Sep 21, 2006 11:44 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 25, 2006 10:56 pm
Posts: 39
Ok, I turned RG_Emulation off in globals.php and turned register_globals off in .htaccess.

But what about the other settings recommended here:

Quote:
register_globals = 0
disable_functions = show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
allow_url_fopen = 0
magic_quotes_gpc = 1
safe_mode = 1
open_basedir = /dir/to/include/change_me/



Top
  E-mail  
 
Posted: Fri Sep 22, 2006 4:20 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Mon Jun 19, 2006 5:54 pm
Posts: 313
Those can be set through .htaccess as well.


Top
  E-mail  
 
Posted: Fri Sep 22, 2006 9:10 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 25, 2006 10:56 pm
Posts: 39
OK, great.

Do I just list them in the .htaccess file like they are listed here. (Of course, with the exception of the Emulation part)?


Top
  E-mail  
 
Posted: Fri Jun 29, 2007 7:58 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Oct 11, 2006 4:50 pm
Posts: 7
Location: São Paulo/Brazil
zman818 wrote:
Those can be set through .htaccess as well.


I can't set safe_mode on the .htaccess file...


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

Quick reply

 



Who is online

Users browsing this forum: acawley, hem100 and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group