PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > php.ini not being read in vista
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
php.ini not being read in vista

Réponse
 
LinkBack Outils de la discussion
Vieux 27/02/2008, 02h50   #1
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut php.ini not being read in vista

I tried to turn on magic_quotes_gpc

behavior shows that it is Off
phpinfo shows it is Off
phpinfo shows path to config file as C:\php\php.ini


setting:
magic_quotes_gpc = On
in C:\php\php.ini does nothing

putting garbage into C:\php\php.ini results in NO error in
Apache's error.log

renaming C:\php\php.ini has No effect

So it must be using default settings. How do I fix?

I hate vista


  Réponse avec citation
Vieux 27/02/2008, 03h01   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
> I tried to turn on magic_quotes_gpc
>
> behavior shows that it is Off
> phpinfo shows it is Off
> phpinfo shows path to config file as C:\php\php.ini
>
>
> setting:
> magic_quotes_gpc = On
> in C:\php\php.ini does nothing
>
> putting garbage into C:\php\php.ini results in NO error in Apache's
> error.log
>
> renaming C:\php\php.ini has No effect
>
> So it must be using default settings. How do I fix?
>
> I hate vista
>
>
>


Does the webserver's userid have access to the php.ini file?

Now you know why I don't use Vista :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 27/02/2008, 03h14   #3
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry Stuckle wrote:
> Jerry wrote:
>> I tried to turn on magic_quotes_gpc
>>
>> behavior shows that it is Off
>> phpinfo shows it is Off
>> phpinfo shows path to config file as C:\php\php.ini
>>
>>
>> setting:
>> magic_quotes_gpc = On
>> in C:\php\php.ini does nothing
>>
>> putting garbage into C:\php\php.ini results in NO error in Apache's
>> error.log
>>
>> renaming C:\php\php.ini has No effect
>>
>> So it must be using default settings. How do I fix?
>>
>> I hate vista
>>
>>
>>

>
> Does the webserver's userid have access to the php.ini file?


thanks. I guess there's no easy fix and I'll have to delve into
accomplishing that tomorrow. I had the quaint notion that I
shouldn't have the OS fighting me at every turn - and so I could
focus on actually using the computer instead of fighting the OS.

>
> Now you know why I don't use Vista :-)
>


nobody had told me that it was permanent beta, either. As in how
it won't connect to some routers. As in how it might disconnect
dialup when switching users. On and on. Sometimes it won't come
out of sleep (why doesn't that happen to Bill gates?) hehe...
  Réponse avec citation
Vieux 27/02/2008, 03h27   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
> Jerry Stuckle wrote:
>> Jerry wrote:
>>> I tried to turn on magic_quotes_gpc
>>>
>>> behavior shows that it is Off
>>> phpinfo shows it is Off
>>> phpinfo shows path to config file as C:\php\php.ini
>>>
>>>
>>> setting:
>>> magic_quotes_gpc = On
>>> in C:\php\php.ini does nothing
>>>
>>> putting garbage into C:\php\php.ini results in NO error in Apache's
>>> error.log
>>>
>>> renaming C:\php\php.ini has No effect
>>>
>>> So it must be using default settings. How do I fix?
>>>
>>> I hate vista
>>>
>>>
>>>

>>
>> Does the webserver's userid have access to the php.ini file?

>
> thanks. I guess there's no easy fix and I'll have to delve into
> accomplishing that tomorrow. I had the quaint notion that I shouldn't
> have the OS fighting me at every turn - and so I could focus on actually
> using the computer instead of fighting the OS.
>


If that's the problem, there is an easy fix. Get he webserver user
access to the php.ini file. It's pretty easy - at least on W2K and W2K3
servers.

>>
>> Now you know why I don't use Vista :-)
>>

>
> nobody had told me that it was permanent beta, either. As in how it
> won't connect to some routers. As in how it might disconnect dialup when
> switching users. On and on. Sometimes it won't come out of sleep (why
> doesn't that happen to Bill gates?) hehe...
>


It's Microsoft. :-(. Seriously, I won't install an MS product until at
least 2 service packs have been issued. Then I only install it on a
test system to see if it works yet.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 27/02/2008, 06h55   #5
Chuck Anderson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
> I tried to turn on magic_quotes_gpc
>
> behavior shows that it is Off
> phpinfo shows it is Off
> phpinfo shows path to config file as C:\php\php.ini
>


So I may not have the answer, but ....

> setting:
> magic_quotes_gpc = On
> in C:\php\php.ini does nothing
>
> putting garbage into C:\php\php.ini results in NO error in
> Apache's error.log
>


...... have you set the path in httpd.conf?

# configure the path to php.ini
PHPIniDir "c:/php"

(I don't even know enough about Apache to know if this is necessary, but
it's in my config file.)

> I hate vista
>


I hope I never have to use it. XP does just fine.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

  Réponse avec citation
Vieux 27/02/2008, 14h28   #6
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

..oO(Jerry)

>I tried to turn on magic_quotes_gpc


Besides the other responses: Why do you want to turn them on?
Magic quotes are broken and will be completely removed in PHP 6.
There's no reason to use them.

Micha
  Réponse avec citation
Vieux 27/02/2008, 19h38   #7
Animesh K
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
<snip>
>
> nobody had told me that it was permanent beta, either. As in how it
> won't connect to some routers. As in how it might disconnect dialup when
> switching users. On and on. Sometimes it won't come out of sleep (why
> doesn't that happen to Bill gates?) hehe...


Upgrade to Ubuntu, unless you use some Windows applications (like
photoshop, illustrator, etc). Recent WINE update has fixed quite a few
bugs related to Windows program running in Linux.

Unlike what people say, Linux was easier to install on an older laptop
of mine. No need to search for drivers. No need to insert CDs and do 10
re-starts to just install the basic device drivers.
  Réponse avec citation
Vieux 27/02/2008, 20h54   #8
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
> Jerry Stuckle wrote:
>>
>> If that's the problem, there is an easy fix. Get he webserver user
>> access to the php.ini file. It's pretty easy - at least on W2K and
>> W2K3 servers.

>
> you'd think it would be easy, yes.
>
> httpd.exe is owned by SYSTEM
>
> SYSTEM supposedly has 'Full control' over C:\php\php.ini
>
> but no go.
>
> (As an aside, I presume you also know that even an admin user is denied
> access to some directories in Vista. Go figure. Not surprisingly, there
> is a theory out there that M$ has resolved to throw most resources into
> Vista's replacement and therefore not spend much on improving Vista.)
>
>
> Note to Chuck: yes, my Apache has set--> PHPIniDir "c:/php"
>
> Note to Animesh: this machine is specifically for Flash, and Photoshop -
> so I have to have some M$ OS crap on here. Maybe they'll be a class
> action soon to give Vista users a free XP. Hey, it could happen
>


Jerry,

"Owned by" is not the same as "running as". You need to determine the
user Apache is running as. It may be System (very bad to do), but it
could be something else, also.

If you have Apache set up as a service, look in the Services folder (or
whatever Vista calls it) and check the Properties for Apache.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 27/02/2008, 21h08   #9
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Animesh K wrote:
>
> Upgrade to Ubuntu, unless you use some Windows applications (like
> photoshop, illustrator, etc).


yes, I had downloaded Ubuntu in order to create dual-boot. My
understanding was that Ubuntu was maybe the best version for a
desktop vs a server.

That plan got stalled when I tried to burn an ISO with Vista, and
the exact same Vista machine wouldn't read it's own just-made CD

Once again, I had not the time nor inclination to fight the OS,
to make s simple CD.
  Réponse avec citation
Vieux 27/02/2008, 21h10   #10
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Animesh K wrote:
>
> Upgrade to Ubuntu, unless you use some Windows applications (like
> photoshop, illustrator, etc).


yes, I had downloaded Ubuntu in order to create dual-boot. My
understanding was that Ubuntu was maybe the best version for a
desktop vs a server.

That plan got stalled when I tried to burn an ISO with Vista, and
the exact same Vista machine wouldn't read it's own just-made CD

Once again, I had not the time nor inclination to fight the OS,
to make a simple CD.
  Réponse avec citation
Vieux 27/02/2008, 21h20   #11
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry Stuckle wrote:
>
> If that's the problem, there is an easy fix. Get he webserver user
> access to the php.ini file. It's pretty easy - at least on W2K and W2K3
> servers.


you'd think it would be easy, yes.

httpd.exe is owned by SYSTEM

SYSTEM supposedly has 'Full control' over C:\php\php.ini

but no go.

(As an aside, I presume you also know that even an admin user is
denied access to some directories in Vista. Go figure. Not
surprisingly, there is a theory out there that M$ has resolved to
throw most resources into Vista's replacement and therefore not
spend much on improving Vista.)


Note to Chuck: yes, my Apache has set--> PHPIniDir "c:/php"

Note to Animesh: this machine is specifically for Flash, and
Photoshop - so I have to have some M$ OS crap on here. Maybe
they'll be a class action soon to give Vista users a free XP.
Hey, it could happen
  Réponse avec citation
Vieux 27/02/2008, 21h33   #12
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Michael Fesser wrote:
>
> Besides the other responses: Why do you want to turn them on?
> Magic quotes are broken and will be completely removed in PHP 6.
> There's no reason to use them.


well, the shared hosting server had them enabled.

But this morning, I determined how to disable them on the server
and so now I am going with magic_quotes_gpc disabled and using
mysql_real_escape_string() for every INSERT and SELECT to MySQL
(those are all the MySQL that I use.)

So: the PHP manual page on "mysql_real_escape_string" gives the
following example. My question: why are numbers or numeric
strings deliberately not escaped?

// Quote variable to make safe
function quote_smart($value)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// Quote if not a number or a numeric string
if (!is_numeric($value)) {
$value = "'" . mysql_real_escape_string($value) . "'";
}
return $value;
}


(sorry for the double-post before. The newsserver had told me
that the first posting had timed out.)
  Réponse avec citation
Vieux 27/02/2008, 21h46   #13
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

..oO(Jerry)

>Michael Fesser wrote:
>>
>> Besides the other responses: Why do you want to turn them on?
>> Magic quotes are broken and will be completely removed in PHP 6.
>> There's no reason to use them.

>
>well, the shared hosting server had them enabled.
>
>But this morning, I determined how to disable them on the server
>and so now I am going with magic_quotes_gpc disabled


Good.

>and using
>mysql_real_escape_string() for every INSERT and SELECT to MySQL
>(those are all the MySQL that I use.)


You should also consider to use PDO and prepared statements instead.
On the long run this will be the much more flexible and powerful way.

>So: the PHP manual page on "mysql_real_escape_string" gives the
>following example. My question: why are numbers or numeric
>strings deliberately not escaped?


If you've checked that the value is a number actually, you don't have to
escape it, simply because a number can't do any harm to the database.
Strings OTOH may contain characters that have a special meaning in an
SQL query. If you want the DB to interpret those chars literarily, you
have to escape them. That's what mysql_real_escape_string() does.

Micha
  Réponse avec citation
Vieux 28/02/2008, 00h51   #14
Tony
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Jerry wrote:
> I tried to turn on magic_quotes_gpc
>
> behavior shows that it is Off
> phpinfo shows it is Off
> phpinfo shows path to config file as C:\php\php.ini
>
>
> setting:
> magic_quotes_gpc = On
> in C:\php\php.ini does nothing
>
> putting garbage into C:\php\php.ini results in NO error in Apache's
> error.log
>
> renaming C:\php\php.ini has No effect
>
> So it must be using default settings. How do I fix?


Did you restart Apache?


> I hate vista


Doesn't thrill me either.
  Réponse avec citation
Vieux 28/02/2008, 01h31   #15
Jerry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Tony wrote:

> Did you restart Apache?


yes, thanks. Many times. It would have been nice if Apache gave a
notice that it was using a default ini config.

I am using .htaccess on the server to give a directive to disable
Magic Quotes. I suppose I could also use that approach to enable
them on my local machine, if ever necesary. IIRC there is a
performance hit that comes with using .htaccess (since each
subdirectory must then be searched for the existence of any
overriding .htaccess). But in my case, with low traffic, that
shouldn't matter much at all.
  Réponse avec citation
Vieux 28/02/2008, 10h45   #16
Satya
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

On Feb 28, 6:31 am, Jerry <Je...@nospam.not> wrote:
> Tony wrote:
> > Did you restart Apache?

>
> yes, thanks. Many times. It would have been nice if Apache gave a
> notice that it was using a default ini config.
>
> I am using .htaccess on the server to give a directive to disable
> Magic Quotes. I suppose I could also use that approach to enable
> them on my local machine, if ever necesary. IIRC there is a
> performance hit that comes with using .htaccess (since each
> subdirectory must then be searched for the existence of any
> overriding .htaccess). But in my case, with low traffic, that
> shouldn't matter much at all.


If you installed it using xammp then it will use the php.ini in apache/
bin folder. and not one in other places. Check correctly in phpinfo()
output which php.ini they are using. Then change the php.ini and
restart apache. You may have tried it. Still telling!
  Réponse avec citation
Vieux 28/02/2008, 13h12   #17
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: php.ini not being read in vista

Satya wrote:
> On Feb 28, 6:31 am, Jerry <Je...@nospam.not> wrote:
>> Tony wrote:
>>> Did you restart Apache?

>> yes, thanks. Many times. It would have been nice if Apache gave a
>> notice that it was using a default ini config.
>>
>> I am using .htaccess on the server to give a directive to disable
>> Magic Quotes. I suppose I could also use that approach to enable
>> them on my local machine, if ever necesary. IIRC there is a
>> performance hit that comes with using .htaccess (since each
>> subdirectory must then be searched for the existence of any
>> overriding .htaccess). But in my case, with low traffic, that
>> shouldn't matter much at all.

>
> If you installed it using xammp then it will use the php.ini in apache/
> bin folder. and not one in other places. Check correctly in phpinfo()
> output which php.ini they are using. Then change the php.ini and
> restart apache. You may have tried it. Still telling!
>


Did you read his first post?

phpinfo shows path to config file as C:\php\php.ini


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  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 06h20.


É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,25816 seconds with 25 queries