SN1P3R_85 Posted August 31, 2008 Share Posted August 31, 2008 This will probably sound really ignorant to some of you guys, but im wondering where i can access my php.ini file. Today i set my domain name up to be hosted on a server, with 1and1.com. The timezone is off, and i would like to go into the php.ini file and change that setting. I can't figure out how to find it. Bear with my php-noobishness. thanks Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 31, 2008 Share Posted August 31, 2008 To update your php.ini on a 1&1 server you need to do so via .htaccess mods. Simple upload them to the domains root folder as .htaccess and they will pick up. I believe you might be able to do it by also uploading mods to php.ini in the same fashion but I know you can do it as .htaccess mods for 1&1 because I have done it myself. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 31, 2008 Share Posted August 31, 2008 If you are on shared hosting, the master php.ini is not accessible. In this case you should be able to put settings into a .htaccess file (when php is running as an Apache module) or in a local php.ini (when php is running as a CGI wrapper/application.) If you are on VPS or dedicated hosting, you would have access to the master php.ini. If you cannot locate it through browsing the directory structure, use a phpinfo(); statement. The line for "Loaded Configuration File" will indicate where the php.ini is getting loaded from. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 im sorry guys, but i don't understand much of this at all . I am truly new with php, so i need you guys to be a bit more specific. This all sounds good, but could one of you tell me exactly how to do this? thanks Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 31, 2008 Share Posted August 31, 2008 make a file in your text editor put in it the php things you want similar to this example php_flag register_globals on save as .htaccess and upload to your domains root folder via ftp. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 k, thanks. So, should i include everything that is normally in a php.ini folder? If i dont' will it overwrite the old php.ini file? For example, if i want to change the time-zone, then if i did this: <?php date.timezone = "timezone_here" ?> would it work, without messing up the rest of my php.ini settings? Quote Link to comment Share on other sites More sharing options...
gentooman Posted August 31, 2008 Share Posted August 31, 2008 I know that many Linux/Unix systems buries the php.ini file some where in the /etc/ or /usr/local/etc/ directories. You can always use this command to find it: find /etc/ -iname '*php.ini*' or find /usr/local/etc/ -iname '*php.ini*'. You do not really need the wildcards but some systems have things such as php.ini.distribution and no php.ini by default. I hope that helps. However, for what I read above, this might not help with this particular hosting service. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 31, 2008 Share Posted August 31, 2008 it only rewrites what ever is "flagged" so no only include modifications so your .htaccess should be php_flag date.timezone = timezone_here try it and upload it at worse u get a 500 error if so then just upload a blank .htaccess file and u good to go Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 thanks alot, i'll try it right now. Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 k, so i tried it, and got one of those errors. I loaded the blank file and it returned to normal. This is what i had inside the file: php_flag date.timezone = Los_Angeles I also tried it once with quotes around Los_Angeles. Do i need the <?php tag? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 31, 2008 Share Posted August 31, 2008 What exact error did you get? Please read my post above (and the FAQ at 1and1.com). You need to start by determining how php is implemented on the web server. Php settings don't work (and in fact cause server errors) when put into a .htaccess file when php is running as a CGI wrapper. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 31, 2008 Share Posted August 31, 2008 sorry forgot its a value not a flag try php_value date.timezone Los_Angeles Make sure Los_Angeles is a valid php date time zone Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webadmin@kundenserver.de and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. --------------------------------------------------------------------------------------------------------------------------------- that is my error. I have no clue what kind of hosting it is, how can i find out? Or should i just attempt to make my own php.ini file? Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 btw, i tried php_value, and it didnt' work Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 i read an faq at 1and1.com, and it says that the beginner linux package is supported by the apache web server. It also said that .htaccess can be used to change the settings on these packages. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 31, 2008 Share Posted August 31, 2008 On basic shared hosting, you can change web server settings in a .htaccess file, but not php settings - http://faq.1and1.com/scripting_languages_supported/php/14.html Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 ya, i just found this faq a few minutes ago. I tried loading my own php.ini file, but it didn't seem to work . this is what it contained: date.timezone =America/Los_Angeles and i saved it as php.ini. any obvious mistakes? Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 c'mon guys, I really need this. Just please point me in the right direction. If I wanted to change the timezone, how would i go about it. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted August 31, 2008 Share Posted August 31, 2008 What about using putenv()? putenv("TZ=America/Los_Angeles"); echo date("jS F Y, h:ia"); Quote Link to comment Share on other sites More sharing options...
SN1P3R_85 Posted August 31, 2008 Author Share Posted August 31, 2008 ya, i ended up doing that, i was looking for a way to edit the php.ini file, but this works. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.