473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

php.ini settings not taking effect

Don
I just put up php.ini-recommended as php.ini in the server-side working directory where my php
scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php
script using "get_magic_quotes_gpc()" I find it is set to "On". I thought all I had to do was setup
php.ini the way I wanted it and locate it in the working directory. As it turned out, I didn't have
to make any changes to php.ini, just renamed it from php.ini-recommended.

Any help would be apprecited.
Thanks,
Don
Jul 17 '05 #1
13 11038
On Thu, 04 Nov 2004 16:22:40 -0700, Don <no@adr.com> wrote:
I just put up php.ini-recommended as php.ini in the server-side working directory where my php
scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php
script using "get_magic_quotes_gpc()" I find it is set to "On". I thought all I had to do was setup
php.ini the way I wanted it and locate it in the working directory. As it turned out, I didn't have
to make any changes to php.ini, just renamed it from php.ini-recommended.


Use the phpinfo() function to dump configuration settings, one of the first
lines is the location of php.ini that PHP is actually using. It sounds like
this isn't the location you've modified.

The PHPRC environment variable can be useful for telling PHP which directory
to look in. The locations it looks in by default depend on your platform.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Don
On Fri, 05 Nov 2004 00:08:36 +0000, Andy Hassall <an**@andyh.co.uk> wrote:
On Thu, 04 Nov 2004 16:22:40 -0700, Don <no@adr.com> wrote:
I just put up php.ini-recommended as php.ini in the server-side working directory where my php
scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php
script using "get_magic_quotes_gpc()" I find it is set to "On". I thought all I had to do was setup
php.ini the way I wanted it and locate it in the working directory. As it turned out, I didn't have
to make any changes to php.ini, just renamed it from php.ini-recommended.


Use the phpinfo() function to dump configuration settings, one of the first
lines is the location of php.ini that PHP is actually using. It sounds like
this isn't the location you've modified.

The PHPRC environment variable can be useful for telling PHP which directory
to look in. The locations it looks in by default depend on your platform.


Thanks for your reply Andy. I understand what you're saying. How do I set PHPRC? I would guess I
would do it from within my php script somehow?

Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #3
Don wrote:
On Fri, 05 Nov 2004 00:08:36 +0000, Andy Hassall <an**@andyh.co.uk> wrote:

On Thu, 04 Nov 2004 16:22:40 -0700, Don <no@adr.com> wrote:

I just put up php.ini-recommended as php.ini in the server-side working directory where my php
scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php
script using "get_magic_quotes_gpc()" I find it is set to "On". I thought all I had to do was setup
php.ini the way I wanted it and locate it in the working directory. As it turned out, I didn't have
to make any changes to php.ini, just renamed it from php.ini-recommended.


Use the phpinfo() function to dump configuration settings, one of the first
lines is the location of php.ini that PHP is actually using. It sounds like
this isn't the location you've modified.

The PHPRC environment variable can be useful for telling PHP which directory
to look in. The locations it looks in by default depend on your platform.

Thanks for your reply Andy. I understand what you're saying. How do I set PHPRC? I would guess I
would do it from within my php script somehow?

Don

What platform are you using?

Steve
Jul 17 '05 #4
Don
On Fri, 05 Nov 2004 09:28:46 +0000, Steve Turnbull <au****@dsl.pipex.com> wrote:
Don wrote:
On Fri, 05 Nov 2004 00:08:36 +0000, Andy Hassall <an**@andyh.co.uk> wrote:

On Thu, 04 Nov 2004 16:22:40 -0700, Don <no@adr.com> wrote:
I just put up php.ini-recommended as php.ini in the server-side working directory where my php
scripts are located. The file has "magic_quotes_gpc" set to "Off", but when I test it within my php
script using "get_magic_quotes_gpc()" I find it is set to "On". I thought all I had to do was setup
php.ini the way I wanted it and locate it in the working directory. As it turned out, I didn't have
to make any changes to php.ini, just renamed it from php.ini-recommended.

Use the phpinfo() function to dump configuration settings, one of the first
lines is the location of php.ini that PHP is actually using. It sounds like
this isn't the location you've modified.

The PHPRC environment variable can be useful for telling PHP which directory
to look in. The locations it looks in by default depend on your platform.

Thanks for your reply Andy. I understand what you're saying. How do I set PHPRC? I would guess I
would do it from within my php script somehow?

Don

What platform are you using?

Steve

Hi Steve,

Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4

Thanks,
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #5
php.ini must be copied to the windowsdirectory

"Don" <no@adr.com> schreef in bericht
news:7k********************************@4ax.com...
On Fri, 05 Nov 2004 09:28:46 +0000, Steve Turnbull <au****@dsl.pipex.com>
wrote:
Don wrote:
On Fri, 05 Nov 2004 00:08:36 +0000, Andy Hassall <an**@andyh.co.uk>
wrote:
On Thu, 04 Nov 2004 16:22:40 -0700, Don <no@adr.com> wrote:
>I just put up php.ini-recommended as php.ini in the server-side working
>directory where my php
>scripts are located. The file has "magic_quotes_gpc" set to "Off", but
>when I test it within my php
>script using "get_magic_quotes_gpc()" I find it is set to "On". I
>thought all I had to do was setup
>php.ini the way I wanted it and locate it in the working directory. As
>it turned out, I didn't have
>to make any changes to php.ini, just renamed it from
>php.ini-recommended.

Use the phpinfo() function to dump configuration settings, one of the
first
lines is the location of php.ini that PHP is actually using. It sounds
like
this isn't the location you've modified.

The PHPRC environment variable can be useful for telling PHP which
directory
to look in. The locations it looks in by default depend on your
platform.
Thanks for your reply Andy. I understand what you're saying. How do I
set PHPRC? I would guess I
would do it from within my php script somehow?

Don

What platform are you using?

Steve

Hi Steve,

Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4

Thanks,
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---

Jul 17 '05 #6
On Sat, 6 Nov 2004 02:35:17 +0100, "Polaris" <as*********@hotmail.com> wrote:
What platform are you using?


Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4


php.ini must be copied to the windowsdirectory


Which sort of Unix has a Windows directory?

Even on Windows that advice is bad, keep things out of the Windows directory.
Either put it in one of the various places PHP looks (depending on which
webserver you're using) or set PHPRC environment variable.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #7
On Fri, 05 Nov 2004 05:33:09 -0700, Don <no@adr.com> wrote:
Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4


What does phpinfo() say the path it is using is?

I tend to have php.ini in the same directory as Apache's httpd.conf, but it's
configurable, either with PHPRC or at PHP compile time.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #8
You did restart your server, right? I mean after you made the chanegs
in php.ini you wanted, they wont take affect until after you've
restarted Apache.
Jul 17 '05 #9
Don
On 5 Nov 2004 21:22:17 -0800, il**********@gmail.com (Illusionistx) wrote:
You did restart your server, right? I mean after you made the chanegs
in php.ini you wanted, they wont take affect until after you've
restarted Apache.

I don't have control over the server in this case, as it runs on my host's server.
Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #10
Don
On Sat, 06 Nov 2004 02:00:00 +0000, Andy Hassall <an**@andyh.co.uk> wrote:
On Fri, 05 Nov 2004 05:33:09 -0700, Don <no@adr.com> wrote:
Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4


What does phpinfo() say the path it is using is?

I tend to have php.ini in the same directory as Apache's httpd.conf, but it's
configurable, either with PHPRC or at PHP compile time.


phpinfo():
Apache 1.3.27
Unix
PHP 4.3.4
Using php.ini at: /usr/local/lib/php.ini

Is that /usr/local/lib/php.ini a directory that I have access to? If so, how do I access it? I
don't have control over Apache's httpd.conf, as I'm running my php scripts on my ISP server. I have
a ticket into them to find out why their PHP apparently isn't looking in my working directory on
their server (where my php scripts are) for my php.ini. However, I think I read that one can tell
PHP the location of the php.ini file to use via the PHPRC environment variable. I at a loss on this
one. Sure could use some help.

Thanks,
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #11
On Fri, 05 Nov 2004 23:30:46 -0700, Don <no@adr.com> wrote:
On Sat, 06 Nov 2004 02:00:00 +0000, Andy Hassall <an**@andyh.co.uk> wrote:
On Fri, 05 Nov 2004 05:33:09 -0700, Don <no@adr.com> wrote:
Thanks for your reply. Just did a phpinfo() and got the following:
Apache 1.3.27
Unix
PHP 4.3.4
What does phpinfo() say the path it is using is?

I tend to have php.ini in the same directory as Apache's httpd.conf, but it's
configurable, either with PHPRC or at PHP compile time.


phpinfo():
Apache 1.3.27
Unix
PHP 4.3.4
Using php.ini at: /usr/local/lib/php.ini

Is that /usr/local/lib/php.ini a directory that I have access to? If so, how do I access it? I
don't have control over Apache's httpd.conf, as I'm running my php scripts on my ISP server.


That would have been a useful bit of information to post earlier - since you
asked why your changes to php.ini aren't being picked up, it gives the
impression you control the server in the first place...
I have
a ticket into them to find out why their PHP apparently isn't looking in my working directory on
their server (where my php scripts are) for my php.ini.
It shouldn't do. PHP configuration, at least for the Apache module version
(another assumption - running as a module is the most common configuration) is
only read when Apache starts. Even if you could change php.ini at runtime,
which if you're just a user you can't, then it wouldn't make any difference
because PHP doesn't even read it until next startup.

Even that assumption might be inaccurate; you could be running PHP as CGI,
which is slower, but there's then the opportunity to point it at your own
php.ini file through $PHPRC or a command-line switch in the #! line at the top
of the script.
However, I think I read that one can tell
PHP the location of the php.ini file to use via the PHPRC environment variable. I at a loss on this
one. Sure could use some help.


I'm trying to help but you've not given enough information, and the
situation's changed now you've said you're a user on somebody else's server,
rather than setting up your own.

Take a step back - you've been asking how to change php.ini - this is almost
certainly the wrong approach. Your ISP is not going to change something
server-wide just for your benefit, it'll break other people's scripts.

You mentioned in the original post that what you were actually trying to do is
turn off magic_quotes_gpc.

There are several places to alter PHP configuration settings:

(1) Server-wide in php.ini. Only read at startup. Only the administrator can
change it.

(2) At runtime, with ini_set(). Only works for a subset of options.
magic_quotes_gpc is not one of them. See the manual for the list.

(3) In an Apache .htaccess file. Depends on your configuration. You can change
more settings here than you can with ini_set(), but not all of them. You _can_
change magic_quotes_gpc.

And of course, read the manual: http://www.php.net/manual/en/configuration.php
Each of these options is explained there.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #12
In article <3q********************************@4ax.com>,
Andy Hassall <an**@andyh.co.uk> wrote:

:Which sort of Unix has a Windows directory?

Red Hat 6 running Gnome
OS X 10.1
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #13
On Sat, 06 Nov 2004 07:47:18 -0500, Warren Oates <Wa**********@Gmail.com>
wrote:
:Which sort of Unix has a Windows directory?

Red Hat 6 running Gnome
OS X 10.1


andyh@server:~$ mkdir Windows

OK, fair enough. Which sort of Unix has a Windows directory that PHP by
default looks for its php.ini file in, then? :-p

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gopal | last post by:
Hi, I've a module report.py having a set of funtions to open/close/write data to a log file. I invoke these functions from another module script.py. Whenever I'm changing something in...
1
by: buht | last post by:
Hello. Ive got a form with one richtextbox object called outputBox. When I click a button on the form that calls some other things to happen one of those things is setting the...
2
by: Ryan McLean | last post by:
Hello everyone! I am having a frustrating problem. I have an asp.net project in visual studio. I was trucking along getting my project complete, when today; I noticed that no changes I was...
19
by: Linda | last post by:
In classic ASP I used to have a file called settings.asp included on every page of my web, it consisted of a number of different settings unique to this application, among them the database path...
0
by: christopher_gedemer | last post by:
I'm new to web-services and am currently having a problem when I update the webservice code on my server. When I update my code in the asmx.vb file and post it, it is not taking effect. For...
10
by: ajtaylor | last post by:
Hello, I have a load of native C++ code that I want to use in a CLR class library. My "logic" being that I create a C++/CLI managed class that acts as an interface to the unmanged code. I...
3
by: tshad | last post by:
Using asp.net 2.0, I am finding that at times, the old javascript will still be there. I was working with it for a couple of hours and the changes seem to happen. But at the end of the day, I...
3
by: =?Utf-8?B?Z3JlYXRiYXJyaWVyODY=?= | last post by:
Here is my code. Does anyone know why when i reopen the table to view the data, none of the rows have been written? DownloadFileDataSet.DownloadFileRow MainTableRow =...
0
by: Chocolade | last post by:
I created a new form and added split container and then on the left side a treeview and on the treeview i added nodes and on the right side of the split container i added a groupbox. Now in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.