Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configure php.ini via .htaccess file?

Status
Not open for further replies.

alsaffar

Programmer
Oct 25, 2001
165
KW
Hi guys,

How can I configure php.ini file via .htaccess file?

It seems that session.use_trans_sid is disabled with me, so my WebHost told that I have to reconfigure the php.ini file from .htaccess file that lied in the public_html directory, I tried in so many ways, but everytime it gave "Internal Server Error" when I borwose my script via IE!!!

My scripts to test the SID insertion in the URL if the cookies are disabled failed:

Session1.php:
Code:
<?
session_start();
$IPAddress = getenv (&quot;REMOTE_ADDR&quot;); 
session_register(&quot;IPAddress&quot;);
echo &quot;My IPAddress is $IPAddress&quot;;
?>
<a href=&quot;Session2.php><?=SID?>&quot;> Click here to test session variable</a>

and Session2.php:
Code:
<?
session_start();
$IPAddress = $HTTP_SESSION_VARS[IPAddress];
echo &quot;My IPAddress is $IPAddress&quot;;
?>

If you set:

IE 6.0.26 -> Tools -> Internet Options -> Privacy -> Advance -> Select Prompt for First-Party Cookies

and Test the first script &quot;Session1.php&quot; you'll be prompt to accept the requested cookie, just block it, and then if you click on the link provided you'll be prompt one more time, just block that cookie, finally, the SID is not sent automaticaly when the cookies are disabled!

Please help me to test these 2 scripts with your server, will you get the same problem that I have? if not, then I have to re-configure the .htaccess file to enable session.use_trans_sid.

I tried to set session.use_trans_sid on by the follwoing command:

php_flag session.use_trans_sid = on

as its mentioned at http://www.faqts.com/knowledge_base/view.phtml/aid/13037/fid/51

and I tried to set it like this:

<IfModule mod_php4.c>
php_flag session.use_trans_sid = on
</IfModule>

as its mentioned at http://www.php.net/manual/en/printwn/configuration.php

But none of them worked fine with me? why?

Please anyone can help?
 
After configuring the .htaccess file with:

<IfModule mod_php4.c>
php_flag session.use_trans_sid on;
</IfModule>

Now, it stopped giving me the &quot;Internal Server Error&quot; but still its not inserting the SID automaticaly in the URL if the cookies are disabled!!!

What do I have to do? Isn't supposed that the SID should be inserted automaticaly if the cookies are disabled? Because this way, it's not working.

Please HELP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top