[FX.php List] How to edit PHP settings

Derrick Fogle derrick at fogles.net
Sun Jan 6 12:06:59 MST 2008


Johnathan's concern is well founded, but I think you've exercised due  
diligence so far. The '.default' file should exactly mirror what PHP's  
internal defaults are, but.... what if they don't? By creating a  
regular php.ini file from the default, you might end up changing some  
other setting that you're not aware of.

But I think you've got to forge ahead. If you run into unexpected  
problems, just disable the php.ini file you create (just rename it  
temporarily), and compare the phpinfo() settings with, and without,  
the .ini file active.


On Jan 6, 2008, at 12:59 PM, Bob Patin wrote:

> Jonathan,
>
> When I ran phpinfo(), I didn't see any place where a php.ini file  
> location is specified; where would that be?
>
> Also, when I did "locate php.ini", I only found the one file, and I  
> know for certain that I've never created a php.ini file on that  
> server (didn't know how!).
>
> Best,
>
> Bob
>
>
> On Jan 6, 2008, at 12:52 PM, Jonathan Schwartz wrote:
>
>> Derrick,
>>
>> I'm worried that there already *is* a php ini in place that he has  
>> yet to locate.  Overwriting with the default may destroy existing  
>> settings.
>>
>> Jonathan
>>
>> At 12:41 PM -0600 1/6/08, Derrick Fogle wrote:
>>> Yes, you're on the right track. When you've only got the "default"  
>>> file, PHP does not even read that file for settings. It just  
>>> defaults to a certain set of settings.
>>>
>>> Just copy that file to php.ini, then edit the php.ini with sudo  
>>> pico. Scroll through the file - you'll find the settings easily  
>>> enough. Change them, save, then restart web services. Now that  
>>> there's an actual php.ini file, it will use the settings in it,  
>>> instead of internal defaults.
>>>
>>> On Jan 6, 2008, at 12:01 PM, Bob Patin wrote:
>>>
>>>> Derrick,
>>>>
>>>> Thanks for the help; I did find this:
>>>>
>>>> /private/etc/php.ini.default
>>>>
>>>> Does this mean that I'm not using one, then, and have to create  
>>>> one?
>>>>
>>>> I've used "sudo pico" before to edit files in Terminal, so I have  
>>>> a *tiny* bit of experience doing this sort of thing; I'd like to  
>>>> change 2 settings:
>>>>
>>>> short_open_tags
>>>> register_globals
>>>>
>>>> to force me to declare variables (perhaps that's not the right  
>>>> variable to change for that?). When I've written PHP apps for  
>>>> other servers, not having declared variables here and there has  
>>>> caused problems; however, the biggie is turning off short open  
>>>> tags.
>>>>
>>>> If you can tell me how to edit this I'd be eternally grateful.
>>>>
>>>> Best,
>>>>
>>>> Bob Patin
>>>> Longterm Solutions
>>>> bob at longtermsolutions.com
>>>> 615-333-6858
>>>> http://www.longtermsolutions.com
>>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>>>
>>>>   CONTACT US VIA INSTANT MESSAGING:
>>>>      AIM or iChat: longterm1954
>>>>      Yahoo: longterm_solutions
>>>>      MSN: tech at longtermsolutions.com
>>>>      ICQ: 159333060
>>>>
>>>> --------------------------
>>>> Contact us for FileMaker hosting and programming for all versions  
>>>> of FileMaker
>>>> PHP * CDML * Full email services * Free DNS hosting * Colocation  
>>>> * Consulting
>>>>
>>>> On Jan 6, 2008, at 11:54 AM, Derrick Fogle wrote:
>>>>
>>>>> Search for your PHP.ini file: In MacOS, open terminal and type:  
>>>>> locate php.ini
>>>>>
>>>>> There's a good chance you'll only find a php.ini.default file.  
>>>>> If so, duplicate it and rename the duplicate to just php.ini. If  
>>>>> you find several, you'll have to figure out for sure which one  
>>>>> is the real file. I'd recommend emailing back with more info  
>>>>> (OS, Apache version, PHP version, where the files were found,  
>>>>> etc.) if that's the case.
>>>>>
>>>>> Once you've located (or created) the right php.ini file, you'll  
>>>>> need to edit it, save the changes, and restart your web  
>>>>> services. I use BBEdit in MacOS GUI, Pico in terminal, or  
>>>>> whatever plain text editor floats your boat for Windows.
>>>>>
>>>>> You'll need admin privs, but it should be easy finding and  
>>>>> changing the short_open_tags directive. You'll do well to browse  
>>>>> through the file and familiarize yourself with the rest of the  
>>>>> directives in the file, too.
>>>>>
>>>>> More info on the PHP.ini file directives can be found at http://php.net 
>>>>> .
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>>
>> -- 
>> Jonathan Schwartz
>> Exit 445 Group
>> jonathan at exit445.com
>> http://www.exit445.com
>> 415-381-1852
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20080106/30c2f308/attachment-0001.html


More information about the FX.php_List mailing list