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 401,571 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,386 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
Views: 1683 | Replies: 1
Reply
Join Date: Dec 2004
Location: India
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Question Creating Local php.ini

  #1  
Aug 17th, 2007
Hello,

I run multiple domains/sites on my linux and windows server. I know there is a php.ini files that comes with the php installation package. But I have heard that there is a way to create a local php.ini file for each domain.

Does anyone knows how to create local php.ini files for each domain. Is there a special setting i need to do to make it run?


Thanx for your help

PS - I use cPanel on my linux server and Plesk on my windows server.
AddThis Social Bookmark Button
Reply With Quote  
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 2:03 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC