User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,274 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,289 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Creating Local php.ini

Join Date: Jul 2007
Location: Sofia, Bulgaria
Posts: 138
Reputation: MitkOK is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: Creating Local php.ini

  #2  
Aug 17th, 2007
Hi there.

You can set php configuration options with ini_set() in every page. There is a limitation I think that with this command you cannot load extensions.

I don't know about Linux, but this is how it can be done on Windows :

httpd.conf :

Include conf/php.conf

php.conf
# PHP Definitions for Apache

# Load PHP Module & Associate .php extensions

#PHP 5
PHPIniDir "C:/web/Apache/conf"
LoadModule php5_module c:/web/PHP/php5apache2_2.dll
AddType application/x-httpd-php .php

# PHP Test & Help Sites
Alias /php "C:/web/webs/php"
Alias /phpmanual "C:/web/PHP/html"

DirectoryIndex index.php index.html index.html.var

Form PHPIniDir will php.ini loaded after restart.

On the other hand :

httpd.conf :

Include conf/sites/*.conf

In sites for example we've got test1.conf :

Alias /test1 C:/web/webs/test1
<Directory "C:/web/webs/test1">
   Order Deny,Allow
   php_flag register_globals off
</Directory>

//

You can use specific apache directives in httpd.conf or .htaccess :

php_value name value

php_flag name on|off

php_admin_value name value

php_admin_flag name on|off



//

With this you have different configuration options for different directories.


- Mitko Kostov
Last edited by MitkOK : Aug 17th, 2007 at 3:03 pm.
Reply With Quote  
All times are GMT -4. The time now is 6:38 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC