It is currently Sat Jul 04, 2009 10:43 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
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  [ 23 posts ] 
Author Message
 Post subject: php.ini tips
Posted: Mon Apr 17, 2006 10:23 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Apr 07, 2006 7:32 pm
Posts: 54
Ok so my webhost has stuck a php.ini in my public_html folder.
i am told i can make changes if i desire to.

any tips on what to turn on/off to help with joomla performance or anything at all?

thanks


You do not have the required permissions to view the files attached to this post.

_________________
preparing is not cheating.


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Mon Apr 17, 2006 10:26 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Apr 14, 2006 11:52 pm
Posts: 319
Location: Colorado Springs, CO
looks alright to me!

_________________
Kelly Karnetsky - CEO, Dreams Redux
http://www.midwestkel.com - Joomla! Hosting, 24/7 Support


Top
   
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 4:24 am 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Nov 16, 2005 2:02 am
Posts: 454
Location: Breklum - Nordfriesland
You should make these changes:

register_globals = Off
magic_quotes_gpc = Off

On production sites:

error_reporting = E_NONE ;
display_errors = Off

On development or test sites:

error_reporting = E_ALL ;
display_errors = On

Regards
Niels


Top
   
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 5:55 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
cylent wrote:
Ok so my webhost has stuck a php.ini in my public_html folder.
i am told i can make changes if i desire to.

any tips on what to turn on/off to help with joomla performance or anything at all?

thanks




You should also consider the following:

upload_max_filesize = 6M;  // user specified max file upload size
session.use_trans_sid = 0;  // user specified don't append session ids
register_globals = Off;  // register globals on or off
post_max_size = 10M;  // user specified post max size
memory_limit = 16M; // user specified Max amt of memory a script may consume (16MB)

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 6:24 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Apr 07, 2006 7:32 pm
Posts: 54
according to the header the host put in to the php.ini file it says:

Quote:
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Bluehost Considerations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If you would like to change the PHP environment for any PHP files
; in your account, make the changes to this file.  Then copy this file to
; all directories, including subdirectories, that have PHP files in them.
;
; NOTE: If you do not copy this file to all directories and subdirectories
; with PHP files, your changes here will not affect those files in other
; directories.


ok so this means i have to put this php.ini file in EVERY joomla directory?
that seems like a lot of work.

_________________
preparing is not cheating.


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 6:29 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Apr 14, 2006 11:52 pm
Posts: 319
Location: Colorado Springs, CO
I thought you only needed to put it in the root directory but I guess not! Have fun with that...

_________________
Kelly Karnetsky - CEO, Dreams Redux
http://www.midwestkel.com - Joomla! Hosting, 24/7 Support


Top
   
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 6:33 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
cylent wrote:
according to the header the host put in to the php.ini file it says:

Quote:
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Bluehost Considerations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If you would like to change the PHP environment for any PHP files
; in your account, make the changes to this file.  Then copy this file to
; all directories, including subdirectories, that have PHP files in them.
;
; NOTE: If you do not copy this file to all directories and subdirectories
; with PHP files, your changes here will not affect those files in other
; directories.


ok so this means i have to put this php.ini file in EVERY joomla directory?
that seems like a lot of work.


Insert this file into your root directory (Call it whateveryouwant.php) and call it from your browser. It will distribute your php.ini file to every directory and subdirectory.
Code:
[<?php
// set this value to Y if you only want to overwrite old php.ini files
// set this value to N if you want to put a php.ini file in every directory
$overwriteOnly = "N";

if ($overwriteOnly == "Y") echo "Operating in Overwrite Only Mode<br><br>";
$path = "/home/" . get_current_user() . "/public_html";
$source = $path . "/php.ini";
if (!file_exists($source)) die('Error - no source php.ini file');
function search($dir) {
  global $source;
  global $overwriteOnly;
  $dh = opendir($dir);
  while (($filename = readdir($dh)) !== false) {
    if ( $filename !== '.' AND $filename !== '..' AND $filename !== 'cgi-bin' AND is_dir("$dir/$filename") ) {
      $path = $dir."/".$filename; 
      $target = $path . "/php.ini";
      if (!file_exists($target) AND $overwriteOnly == "Y") {
        echo "$path <b>skipped - no php.ini file</b><br>";
      } else {
        echo "$target <br>";
        if (!copy($source,$target)) echo "<b>Write failed for $target </b><br>";
        if (file_exists($target)) chmod($target,0600);
    }
      search($path);
    }
  }
  closedir($dh);
}
search($path);
echo "<br>Done.";
?>


Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Last edited by dhuelsmann on Thu Aug 17, 2006 3:07 am, edited 1 time in total.

Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 6:56 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Apr 07, 2006 7:32 pm
Posts: 54
thats beautiful. you are a God to me! /me bows to  dhuelsmann

one question before i proceed though and that is i just was upgraded to a php5 server. does the old php.ini from before the upgrade still work or should i get a new one or shall i proceed?

attached is the file i'll be uploading with the changes you guys suggested.


You do not have the required permissions to view the files attached to this post.

_________________
preparing is not cheating.


Last edited by cylent on Tue Apr 18, 2006 7:03 pm, edited 1 time in total.

Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 11:26 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
cylent wrote:
thats beautiful. you are a God to me! /me bows to  dhuelsmann

one question before i proceed though and that is i just was upgraded to a php5 server. does the old php.ini from before the upgrade still work or should i get a new one or shall i proceed?

attached is the file i'll be uploading with the changes you guys suggested.


From what I understand about PHP5 (and it depends upon your hosts), the php.ini file does NOT need to be propagated to all directories and subdirectories. Ask the question before running the propagation file (I do have another that will remove all php.ini files, if necessary)

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Tue Apr 18, 2006 11:33 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
cylent wrote:
one question before i proceed though and that is i just was upgraded to a php5 server. does the old php.ini from before the upgrade still work or should i get a new one or shall i proceed?
attached is the file i'll be uploading with the changes you guys suggested.


Note: I usually make my changes at the end of the existing php.ini file labelled clearlyy as // USER MODIFIED PARAMETERS FOLLOW

That way you can leave the original php.ini data in place and only modify at one location at the end of the file.

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Wed Apr 19, 2006 5:38 pm 
User avatar
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Apr 07, 2006 7:32 pm
Posts: 54
can you share that removal script with me please since i may need to remove all those php.ini files when i figure out where to put that main file?

_________________
preparing is not cheating.


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Wed Apr 19, 2006 9:14 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
cylent wrote:
can you share that removal script with me please since i may need to remove all those php.ini files when i figure out where to put that main file?


Here you go. Let us know what you find out about PHP5 and php.ini on your server.

(Edited to add explanation on use)

Insert this file into your root directory (Call it whateveryouwant.php) and call it from your browser. It will delete your php.ini file in every directory and subdirectory.


Code:
<?php
// this script will delete all your php.ini files
$path = "/home/" . get_current_user() . "/public_html";
function search($dir) {
  $dh = opendir($dir);
  while (($filename = readdir($dh)) !== false) {
    if ( $filename !== '.' AND $filename !== '..' AND $filename !== 'cgi-bin' AND is_dir("$dir/$filename") ) {
      $path = $dir."/".$filename; 
      $target = $path . "/php.ini";
      if (file_exists($target)) {
        echo "Deleting - $target <br>";
        if (!unlink($target)) echo "<b>Delete failed for $target </b><br>";
    }
      search($path);
    }
  }
  closedir($dh);
}
$target = $path . "/php.ini";
if (file_exists($target)) {
  echo "Deleting - $target <br>";
  if (!unlink($target)) echo "<b>Delete failed for $target </b><br>";
}
search($path);
echo "<br>Done.";
?> 


Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Last edited by dhuelsmann on Wed Apr 19, 2006 9:16 pm, edited 1 time in total.

Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Wed Apr 19, 2006 11:27 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 17, 2005 11:46 pm
Posts: 763
It should be noted that both of these scripts will only work on cPanel hosts that haven't changed the user directory path. But it is a very nice script :)

_________________
Doyle Lewis
BuyHTTP Internet Services
http://www.buyhttp.com/joomla_hosting.html - No Overselling Guarantee. Your Joomla site, faster.
http://www.joomlademo.com - Joomla flash tutorials.


Top
   
 
 Post subject: Re: php.ini tips
Posted: Wed Apr 19, 2006 11:56 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Apr 14, 2006 11:52 pm
Posts: 319
Location: Colorado Springs, CO
Damn son that is a very nice script. Something to put away for a rainy day!  ;D

_________________
Kelly Karnetsky - CEO, Dreams Redux
http://www.midwestkel.com - Joomla! Hosting, 24/7 Support


Top
   
 
 Post subject: Re: php.ini tips
Posted: Thu May 25, 2006 7:09 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Mon Mar 27, 2006 8:27 pm
Posts: 296
Location: Indiana, USA
I put this php.ini file in my root directory and made the extra .php file telling it to load the ini file in all directories.  I'm also running PHP5.  I am however still getting the error "Upload Failed".  Please help!

_________________
Professional Joomla extensions by DTH Development
// http://www.DTHDevelopment.com //
DT Register | DT Billing | DT Donate


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Thu May 25, 2006 8:23 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
directtech wrote:
I put this php.ini file in my root directory and made the extra .php file telling it to load the ini file in all directories.  I'm also running PHP5.  I am however still getting the error "Upload Failed".  Please help!


Did you check first with your host to see if they allow you to set-up your own php.ini? And, if they do, someone elses would not be appropriate, you need to get your host to provide their starting point.

Regards

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Last edited by dhuelsmann on Thu Aug 17, 2006 3:04 am, edited 1 time in total.

Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Fri Aug 25, 2006 2:11 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 29, 2006 6:55 pm
Posts: 15
dhuelsmann wrote:
directtech wrote:
I put this php.ini file in my root directory and made the extra .php file telling it to load the ini file in all directories.  I'm also running PHP5.  I am however still getting the error "Upload Failed".  Please help!


Did you check first with your host to see if they allow you to set-up your own php.ini? And, if they do, someone elses would not be appropriate, you need to get your host to provide their starting point.

Regards

Dave

Hi again, Dave!

Thanks for sending me that email for clarification on how to post the php.ini.  Sorry it has taken me a couple of days to respond... I just started medical school this week and it has been hectic!

I created a whatever.php file in notepad by copying and pasting your input script listed above.  I placed it in the root directory along with my altered php.ini file.  Then, I opened IE and went to http://www.mydomain/whatever.php.&nbsp; I could see the script but when I checked it out on FileZilla, I didn't find the php.ini file in any other directory than the root.  It should be visible, correct?  I am running PHP version 4.3.11

Thanks Again!

AZPOD


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Fri Aug 25, 2006 2:17 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
AZPOD wrote:
dhuelsmann wrote:
directtech wrote:
I put this php.ini file in my root directory and made the extra .php file telling it to load the ini file in all directories.  I'm also running PHP5.  I am however still getting the error "Upload Failed".  Please help!


Did you check first with your host to see if they allow you to set-up your own php.ini? And, if they do, someone elses would not be appropriate, you need to get your host to provide their starting point.

Regards

Dave

Hi again, Dave!

Thanks for sending me that email for clarification on how to post the php.ini.  Sorry it has taken me a couple of days to respond... I just started medical school this week and it has been hectic!

I created a whatever.php file in notepad by copying and pasting your input script listed above.  I placed it in the root directory along with my altered php.ini file.  Then, I opened IE and went to http://www.mydomain/whatever.php.&nbsp; I could see the script but when I checked it out on FileZilla, I didn't find the php.ini file in any other directory than the root.  It should be visible, correct?  I am running PHP version 4.3.11

Thanks Again!

AZPOD


It should be visible but keep in mind that the script really only works in a cpanel environment where the hosts haven't changed the userr directory paths.

Regards

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Fri Aug 25, 2006 3:04 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 29, 2006 6:55 pm
Posts: 15
Dave,

Where do I check to see if the host has changed the user directory path?  Also, I have a control panel through GoDaddy but do I need to use it to upload the file?  Why does the control panel play into the picture, do you know?  I just used FileZilla to upload the php.ini and the whatever.php and, as mentioned, pointed my browser to it.  However, I am still unable to see the files in any other directory than the root.

Thanks Again,

AZPOD


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Fri Aug 25, 2006 12:34 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
AZPOD wrote:
Dave,

Where do I check to see if the host has changed the user directory path?  Also, I have a control panel through GoDaddy but do I need to use it to upload the file?  Why does the control panel play into the picture, do you know?  I just used FileZilla to upload the php.ini and the whatever.php and, as mentioned, pointed my browser to it.  However, I am still unable to see the files in any other directory than the root.

Thanks Again,

AZPOD


It is not a control panel but rather cpanel - a very specific control panel provided by many hosting companies. I don't know what go daddy provides for a control panel.

Regards

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Fri Aug 25, 2006 9:46 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 29, 2006 6:55 pm
Posts: 15
I don't think my control panel is cpanel.  When I open the hosting manager software, the option to use the "control panel" is offered and nowhere does is say cpanel that I was able to find. 

Is there a way to add the php.ini in all directories and subdirectories other than by hand and the cpanel?

Thanks,

AZPOD


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Sat Aug 26, 2006 2:05 am 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Sun Oct 02, 2005 12:50 am
Posts: 11288
Location: Omaha, NE
AZPOD wrote:
I don't think my control panel is cpanel.  When I open the hosting manager software, the option to use the "control panel" is offered and nowhere does is say cpanel that I was able to find. 

Is there a way to add the php.ini in all directories and subdirectories other than by hand and the cpanel?

Thanks,

AZPOD


Sorry, I don't have any additonal info on your configuration that would help.

Regards

Dave

_________________
Regards, Dave Global Moderator
Your question has likely already been answered - Search the forums & the documentation wiki first - and only then post your question!
http://www.kiwaniswest.org
http://www.faysgifts.com


Top
  E-mail  
 
 Post subject: Re: php.ini tips
Posted: Sat Aug 26, 2006 5:13 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Sat Aug 20, 2005 3:58 am
Posts: 760
Location: Australia
What I read about this:

Quote:
http://www.washington.edu/computing/web ... p-ini.html


Creating Your Own php.ini File

A php.ini file that you write must overwrite every setting in the UW's global php.ini file to achieve full functionality (see note below). Thus you must obtain a copy of the entire recommended php.ini template, rename it to php.ini, and then adjust the settings of the file to the values you desire. When you're done, you can put the file in your root Web directory to apply custom configuration settings to all your PHP scripts, or you can put it in a subdirectory to apply custom configuration settings to a subset of PHP scripts.

Note: you cannot use your configuration file to extend the Web server's PHP settings. Only settings in your own php.ini will be used if you have one. If you set only a few settings, all other settings will use the hard-coded values in the PHP interpreter.


How a php.ini File is Read


When the PHP interpreter starts up, it behaves according to settings specified in any availabe php.ini file. The Web server will look for this file in the following locations and in the following order:

  1. The directory from which the PHP script was called
  2. The root of your Web directory (typically public_html)
  3. The Web server's default php.ini

The Web server's PHP configuration file will always be used if you don't have your own. You can find the Web server's current php.ini file in /usr/local/php4/lib/php.ini on the Web Development systems. Inspecting the settings in this file may be helpful if you are troubleshooting a problem with your configuration



Does this seem OK?

_________________
Stamboom / Family tree
There is no failure until you give up.
Chris


Last edited by Chris on Sat Aug 26, 2006 5:19 am, edited 1 time in total.

Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 121 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