473,372 Members | 1,088 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,372 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 14177
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.