473,405 Members | 2,187 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,405 software developers and data experts.

Using local php.ini files

My Web Host (Linux - Apache) recently upgraded to Php5. One thing lost
in the upgrade was a global configuration that allowed me to place
php.ini files in any directory and they would be read and used (I don't
know if that was in addition to a global php.ini file or not).

Prior to that (a couple of years ago) php directives were placed in the
htaccess file in the site's root directory, but after an even earlier
upgrade the htaccess directives gave a 500 Server Error. That is when I
was started using local php.ini files instead.

Now I can do neither. The local php.ini files are no longer used and
adding php directives to htaccess causes a 500 Server error.

The directive I am most concerned with is include_path, so I can keep
include files outside of the web site.

I have communicated with my web host a few times about this and they
seem to have no idea what needs to be done. I know, this is pretty
shoddy on their part, but in all other things this host has been very
good, so I'd rather stick with them.

Does anyone have any idea what kind of configuration they used that
allowed the local php ini files to be used?

Is there an Apache configuration directive needed to allow php
directives in the htaccess file?

Thanks for any pointers.

--
*****************************
Chuck Anderson • Boulder, CO
*****************************
Jul 25 '06 #1
4 14183
Chuck Anderson <we************@seemy.sigwrote:
Does anyone have any idea what kind of configuration they used that
allowed the local php ini files to be used?

Is there an Apache configuration directive needed to allow php
directives in the htaccess file?
Chuck,

If PHP is running as a CGI, you could use the special environment
variable PHPRC (see <http://www.php.net/manual/en/configuration.php>)

In your htaccess file, you would then have:

SetEnv PHPRC /path/to/your/php.ini

hih,

JJS.
Jul 26 '06 #2
J.J.SOLARI wrote:
Chuck Anderson <we************@seemy.sigwrote:

>Does anyone have any idea what kind of configuration they used that
allowed the local php ini files to be used?

Is there an Apache configuration directive needed to allow php
directives in the htaccess file?

Chuck,

If PHP is running as a CGI, you could use the special environment
variable PHPRC (see <http://www.php.net/manual/en/configuration.php>)

In your htaccess file, you would then have:

SetEnv PHPRC /path/to/your/php.ini

hih,

JJS.
Thanks. Php is running as a cgi at my web host, so I tried what you
said, ... but no luck. I cannot set the Environment variable PHPRC.

I wonder if permission has to be granted in httpd.conf.

(Note: while researching this I found that you should specify the path
to the directory php.ini is in, not to the file itself. i.e.,
/path/to/your/phpinidirectory)

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Jul 27 '06 #3
Chuck Anderson <we************@seemy.sigwrote:

In your htaccess file, you would then have:

SetEnv PHPRC /path/to/your/php.ini

hih,

JJS.

Thanks. Php is running as a cgi at my web host, so I tried what you
said, ... but no luck. I cannot set the Environment variable PHPRC.

I wonder if permission has to be granted in httpd.conf.

(Note: while researching this I found that you should specify the path
to the directory php.ini is in, not to the file itself. i.e.,
/path/to/your/phpinidirectory)
Chuck,

Indeed, my mistake :(

Also, I forgot to put quotes around ; so, it should read:

SetEnv PHPRC "/path/to/your_php.ini/directory/"

Note that this path is not taken from the server root, but from the
filesystem root (check with phpinfo).

hope it will work this time,

JJS.
Jul 27 '06 #4
J.J.SOLARI wrote:
Chuck Anderson <we************@seemy.sigwrote:
>>In your htaccess file, you would then have:

SetEnv PHPRC /path/to/your/php.ini

hih,

JJS.

Thanks. Php is running as a cgi at my web host, so I tried what you
said, ... but no luck. I cannot set the Environment variable PHPRC.

I wonder if permission has to be granted in httpd.conf.

(Note: while researching this I found that you should specify the path
to the directory php.ini is in, not to the file itself. i.e.,
/path/to/your/phpinidirectory)

Chuck,

Indeed, my mistake :(

Also, I forgot to put quotes around ; so, it should read:

SetEnv PHPRC "/path/to/your_php.ini/directory/"

Note that this path is not taken from the server root, but from the
filesystem root (check with phpinfo).

hope it will work this time,

JJS.
Thanks again, but I already tried several formats (quotes, no quotes,
trailing slash, no trailing slash, ...). I think something is not
allowing me to set that (or Php was compiled to ignore it?).

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Jul 27 '06 #5

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

Similar topics

0
by: Richard Taylor | last post by:
User-Agent: OSXnews 2.07 Xref: number1.nntp.dca.giganews.com comp.lang.python:437315 Hi I am trying to use py2app (http://undefined.org/python/) to package a gnome-python application...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
1
by: Jarred | last post by:
Howdy All, I've been having a bit of a problem that I can't seem to get a grip on at the moment and I'm hoping someone may be able to give me a quick hand :) What I have is a Webservice that...
2
by: createdbyx | last post by:
I am trying to make a file sync utillity to sync files between my laptop and my desktop pc. On my desktop machine (xp pro sp2) I have shared my "Visual Studio Projects" folder using windows simple...
16
by: Asaf | last post by:
I am trying to create and use a COM object with C#.NET 2005. The assembly is set to "Register for COM interop" but when I am trying to call it from VB on Word 2003 I am getting this error: ...
3
by: Indiresh | last post by:
Hi all, I have a problem downloading web pages to my local system. I am using the HttpebRequest class to query a web site and get the response from the same. UndNow, when i asy a web page, all...
1
by: ScottB | last post by:
When creating website applications within Visual Studio 2005, I use the File System method because it meets the needs of our environment. In choosing the location of the directory where the files...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
2
by: Andrus | last post by:
I have resource files in different languages created by VCS 2005 Express. I want to use those files to translate reports at runtime. I have text to be translated as string. I think I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.