PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Re: [PHP] php.ini
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: [PHP] php.ini

Réponse
 
LinkBack Outils de la discussion
Vieux 09/05/2008, 18h59   #1
Wolf
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] php.ini


---- Michael Satterwhite <michael@weblore.com> wrote:
> I'm trying to turn off magic quotes for a site. I've copied the php.ini
> from /etc/php5/apache2 to the web site directory. In this file, I've changed
> magic_quotes_gpc to read
> magic_quotes.gpc = Off
>
> When I run phpinfo() from this directory, it still shows magic quotes as being
> on. I'm guessing there is another configuration parameter (either in the
> Apache configuration or for php) that allows this to be processed. Would
> someone be so kind as to me here; I admit ignorance.
>
> ---Michael

'

When making changes to Apache configuration read files, you have to RESTART APACHE before those changes take effect.

However you can use php's ini_set () function to set a number of settings on the fly that can be changed per page change.

HTH,
Wolf
  Réponse avec citation
Vieux 09/05/2008, 20h02   #2
Michael Satterwhite
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] php.ini

On Friday 09 May 2008 11:59:25 Wolf wrote:

> When making changes to Apache configuration read files, you have to RESTART
> APACHE before those changes take effect.
>
> However you can use php's ini_set () function to set a number of settings
> on the fly that can be changed per page change.


As this is (should be) being read from the user directory containing the
application instead of the global configuration file, I'd expect it to behave
more like the .htaccess file. The use of .htaccess to override apache
configurations doesn't require an apache restart.

I do know that on bluehost, they actually encourage people to use their own
php.ini file in their web directory ... and users certainly don't have the
authority to restart apache.

That said - just for grins, I *DID* restart apache2. It made no difference.
  Réponse avec citation
Vieux 09/05/2008, 20h43   #3
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] php.ini

On Fri, May 9, 2008 at 12:02 PM, Michael Satterwhite <michael@weblore.com>
wrote:

> I do know that on bluehost, they actually encourage people to use their own
> php.ini file in their web directory ... and users certainly don't have the
> authority to restart apache.
>
> That said - just for grins, I *DID* restart apache2. It made no difference.



(from before) /etc/php5/apache2 is a centralized directory; i surprised you
even have access to it on a shared host. do you have your own instance of
linux? either way i sincerely doubt thats the web directory. i would try
putting a .htaccess file in your web root.

php_flag magic_quotes_gpc = Off

when you look at the output of phpinfo() there will be 2 columns. one has
the heading 'master value' the other has the heading 'local value' is the
local value different than the master value? it should be if the .htaccess
file is working correctly (though you many not have permission to use them
[but it is typical to allow php configuration via .htaccess on shared
hosts]).

-nathan

  Réponse avec citation
Vieux 09/05/2008, 21h28   #4
Janet Valade
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] php.ini

Nathan Nobbe wrote:
> On Fri, May 9, 2008 at 12:02 PM, Michael Satterwhite <michael@weblore.com>
> wrote:
>
>
>> I do know that on bluehost, they actually encourage people to use their own
>> php.ini file in their web directory ... and users certainly don't have the
>> authority to restart apache.
>>
>> That said - just for grins, I *DID* restart apache2. It made no difference.
>>

Some web hosts allow you have have your own local php.ini. You just
create an empty php.ini file in your main web directory. After you do
that, the loaded configuration file shown in the output from phpinfo()
will show the path to the local php.ini file. Then, just put the
specific directive in there, such as:

magic_quotes_gpc = Off

This works on some hosts.

Janet

--
----------------
janet.valade.com

  Réponse avec citation
Vieux 09/05/2008, 23h44   #5
Nathan Nobbe
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Fwd: [PHP] php.ini

bouncing back to the list..

---------- Forwarded message ----------
From: Michael Satterwhite <michael@weblore.com>
Date: Fri, May 9, 2008 at 3:09 PM
Subject: Re: [php] php.ini
To: Nathan Nobbe <quickshiftin@gmail.com>


On Friday 09 May 2008 13:43:27 you wrote:
> On Fri, May 9, 2008 at 12:02 PM, Michael Satterwhite <michael@weblore.com>
>
> wrote:
> > I do know that on bluehost, they actually encourage people to use their
> > own php.ini file in their web directory ... and users certainly don't
> > have the authority to restart apache.
> >
> > That said - just for grins, I *DID* restart apache2. It made no
> > difference.

>
> (from before) /etc/php5/apache2 is a centralized directory; i surprised

you
> even have access to it on a shared host. do you have your own instance of
> linux? either way i sincerely doubt thats the web directory. i would try
> putting a .htaccess file in your web root.


I never said it was the web directory ... I said that's where php.ini is
being
loaded from. The web directory is /var/www ... that's where the php.ini I
*WANT* loaded is. ...and, yes, I have my own Linux machine that I use for
testing.
> php_flag magic_quotes_gpc = Off
>
> when you look at the output of phpinfo() there will be 2 columns. one has
> the heading 'master value' the other has the heading 'local value' is

the
> local value different than the master value? it should be if the

..htaccess
> file is working correctly (though you many not have permission to use them
> [but it is typical to allow php configuration via .htaccess on shared
> hosts]).


I've tried that now, and it does work. I was trying to do it through a local
php.ini because I know that's the way bluehost makes us do it, and there are
several websites that document it as a working manner.

I do thank everyone for their with this.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h26.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13512 seconds with 13 queries