For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2007 > Edit php.ini file on windows









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Edit php.ini file on windows
cluthz

2007-04-22, 9:57 pm

Hi there,

Further to a previous positing I need to disable error notifications on a
shared server in the php.ini file.

I know I can achieve this within a particular script using
error_reporting(E_ALL ^ E_NOTICE);

but lets say I want to change the php.ini file so that is always has this
value and notices are suppressed.

How, on a Windows server box with shared hosting do I change the php.ini
value so I do not need to write the above line into each script.

Thanks in advance.


Jonathan

2007-04-22, 9:57 pm

cluthz wrote:
> Hi there,
>
> Further to a previous positing I need to disable error notifications on a
> shared server in the php.ini file.
>
> I know I can achieve this within a particular script using
> error_reporting(E_ALL ^ E_NOTICE);
>
> but lets say I want to change the php.ini file so that is always has this
> value and notices are suppressed.
>
> How, on a Windows server box with shared hosting do I change the php.ini
> value so I do not need to write the above line into each script.


The php.ini file holds general configuration settings and can not be
twed on a directory/share base.

If your shared server is an apache server you could use
php_admin_value/flag keywords to specify directives also defined in the
php.ini file in the configuration directive of your domain in the
httpd.conf file, you can find more information here:
http://www.php.net/configuration.changes .

I have no experience with IIS or other webservers on Windows.

Jonathan
ZeldorBlat

2007-04-22, 9:57 pm

On Apr 22, 2:40 pm, Jonathan <jonat...@heelal.nl> wrote:
> The php.ini file holds general configuration settings and can not be
> twed on a directory/share base.
>


Wrong. You can set many of the configuration directives on a per-
directory basis in apache using .htaccess files:

<http://www.php.net/manual/en/configuration.changes.php>

cluthz

2007-04-22, 9:57 pm

> Wrong. You can set many of the configuration directives on a per-
> directory basis in apache using .htaccess files:
>
> <http://www.php.net/manual/en/configuration.changes.php>


OK great. Anyone know if you can do the same on Windows?


Jonathan

2007-04-23, 9:57 pm

ZeldorBlat wrote:
> On Apr 22, 2:40 pm, Jonathan <jonat...@heelal.nl> wrote:
>
> Wrong. You can set many of the configuration directives on a per-
> directory basis in apache using .htaccess files:
>
> <http://www.php.net/manual/en/configuration.changes.php>
>


That does not make me wrong. I am only suggesting that the general
settings are done in the php.ini file and that no directory/share based
configuration can be set there, in the php.ini file.

You can use .htaccess files to add overwrite directives, but you can
also specify them on a share/directory basis in the httpd.conf file. I
generally like the latter to keep all in one place, but it might not
always be possible.

Kind regards,

Jonathan
Jonathan

2007-04-23, 9:57 pm

cluthz wrote:
>
> OK great. Anyone know if you can do the same on Windows?
>
>

Jonathan

2007-04-23, 9:57 pm

cluthz wrote:
>
> OK great. Anyone know if you can do the same on Windows?


A suggestion is in the last paragraph of the suggested link. Have a look
at the ini_set and ini_get functions, although this might be a solution
prone to errors. Mentioned functions might also be disabled by your
provider, now or in the future.

Jonathan
Jonathan

2007-04-23, 9:57 pm

cluthz wrote:
>
> OK great. Anyone know if you can do the same on Windows?


After reading it again, the link does not state that you can not use the
first method (.htaccess / httpd.conf) files on Windows.

Jonathan
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com