Help with using a .htaccess file, local php.ini, or other

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
roseuz
Forum Newbie
Posts: 1
Joined: Fri Feb 02, 2007 12:29 pm

Help with using a .htaccess file, local php.ini, or other

Post by roseuz »

Hello. Sorry if this has been asked already somewhere, but when I did a search on .htaccess, I didn't find what I was looking for. I need to get this solved as soon as possible and have been desperately looking for help, but haven't been able to find any so far. I have a page that's running PHP on a server that's using PHP 4.4.0. As a result, my sessions are not retaining their values when the page is refreshed or code is repeated, as in a loop: You can read more about it here if you like: http://phosphorusandlime.blogspot.com/2 ... ified.html

The main thing I am trying to accomplish is to turn of the register_globals, which are on in the version the server is using (4.4.0), but off by default in my version, (5.1.1), which is why I didn't experience the problem on my computer. Nonetheless, the solutions for this problem are here: http://www.nyphp.org/phundamentals/ini.php

The part that I am interested in is the section entitled: When You Don’t Control the Server. In particular, I am interested in option 3, which is about using a .htaccess file. Of course if that method doesn't work, I would like to do the others.

The sample code provided at the website for the .htaccess file is the following:

php_value include_path .:/path/to/global/includes:/path/to/local/includes
php_value register_globals 0
php_value error_reporting E_ALL
php_value display_errors 1
php_value auto_prepend_file path/to/my/functions/library/masterfile.php


First of all, before I begin going through each line, I would like to know, where do I put this .htaccess file? In the same section where all my other files are at on the server? Also, would the file be saved as just .htaccess?

O.k. Now, the two main things that I would like clarification on are the first line and last line of the sample code I provided.

Starting with the first line: My include_path listed under the heading of local value and master value as .:/usr/local/lib/php and .:/usr/local/lib/php

So, will my first line be like this: php_value include_path .:/usr/local/lib/php:/.:/usr/local/lib/php
especially, the part after the letters php? (:/.:/)

And also, for the last line, what do they mean by masterfile.php
And will the last line look like this....Actually, I don't know what goes there. I was reading about library functions and came up with the conlusion that this had something to do with curl. If this is the case, this is the information listed for that: CURL Information libcurl/7.11.2 OpenSSL/0.9.7d ipv6 zlib/1.2.1.1
Under the auto_prepend_file section, for local and master value, I have listed No Value

And a quick question about creating a local php.ini file. It's pretty much the same questions I posted about the .htaccess file.

The sample code provided at the website is:

include_path = .:/path/to/global/includes:/path/to/local/includes
register_globals = 0
error_reporting = E_ALL
display_errors = 1

Will the include path be .:/usr/local/lib/php:/.:/usr/local/lib/php (If I posted it correctly the first time, then I am pretty sure it will be like this again, but I just want to be absolutely sure.)

Also, where would the php.ini file go: in the same places where my other files are at on the server?

I hope someone can offer me some help with these issues and am thanking you in advance for any and all help.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I am pretty sure you can control most, if not all, of those settings with ini_set().
Post Reply