p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: .htaccess for php settings


Message #1 by Jefferis Peterson <jefferis@p...> on Mon, 23 Sep 2002 13:37:12 -0400
I have been reading about php.ini files since my server's default is magic
quotes off and I wanted to change it. My host provider said it can be
managed with .htaccess, which sounds strange to me.

Is there a tutorial for using htaccess to modify and govern php.ini files?

Jeff 


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.net
Tel .  xxx-xxx-xxxx
ICQ 19112253

http://www.Slippery-Rock.com - 7,000 hits per year

Message #2 by "Nikolai Devereaux" <yomama@u...> on Mon, 23 Sep 2002 12:22:55 -0700
If PHP is loaded as a module, and your ISP's apache is configured to allow
overrides in your .htaccess files, you can just write additional directives in
your .htaccess files to configure PHP, just like you'd do so in the httpd.conf
file.

http://www.php.net/configuration#AEN2449


hth,

nik

Message #3 by Jefferis Peterson <jefferis@p...> on Mon, 23 Sep 2002 20:03:04 -0400
 I think I need  tutorial on writing the .htaccess since I'm starting
without a document, rather than merely modifying one with specific
instructions for configuring the php aspect. I checked the links, but they
are general php config, and I didn't see anything covering htaccess
modifications...
I need the one for Dummies :-)
> From: "Nikolai Devereaux" <yomama@u...>
>  
> 
> 
> If PHP is loaded as a module, and your ISP's apache is configured to allow
> overrides in your .htaccess files, you can just write additional directives in
> your .htaccess files to configure PHP, just like you'd do so in the httpd.conf
> file.
> 
> http://www.php.net/configuration#AEN2449
> 
> 
> hth,
> 
> nik

~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.net
Tel .  xxx-xxx-xxxx
ICQ 19112253

http://www.Slippery-Rock.com - 7,000 hits per year

Message #4 by "Nikolai Devereaux" <yomama@u...> on Tue, 24 Sep 2002 10:04:13 -0700
>  I think I need  tutorial on writing the .htaccess since I'm starting
> without a document, rather than merely modifying one with specific
> instructions for configuring the php aspect. I checked the links, but they
> are general php config, and I didn't see anything covering htaccess
> modifications...

If you're not trying to manage user authentication via your .htaccess file, the
entire contents of the .htaccess file can just be the PHP configuration
settings.


in other words:

----- .htaccess  -------
<IfModule mod_php4.c>
  php_flag magic_quotes_gpc on
  php_flag magic_quotes_runtime on
</Ifmodule>
------------------------


There's a lot of info out there about writing .htaccess files.  I'd start by
poking through an Apache book or looking at their documentation online.  Also,
a simple google search for ".htaccess tutorial" yielded several hits.

Take care,

nik


  Return to Index