setting up apache "virtual servers" with custom php.ini's

Posted on 2005-03-01
Medium Priority
Last Modified: 2013-11-15
Ok, my current host (www.powweb.com) allows each user to eith use the default php settings, OR create their own php.ini file, and put it in their htdocs dir. I'm trying to do something similar with a server I have that will host a few different test sites. How would I go about doing this?
Question by:aaroncampbell
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 51

Accepted Solution

ahoffmann earned 2000 total points
ID: 13432670
if you use php as module in apache (mod_php) then you can only have one php.ini (searched at the default place), 'hence there is no way to have different ones for each virtual host.
You need to use PHP as CGI, then each CGI can read its own php.ini.
Or you need to use one serverinstance for each virtual host (which requires a unique IP for each)

Author Comment

ID: 13432941
The problem is, I'm running php as a module, and would like to be able to still do this.  Does anyone know of a way to do this with php as a module?
LVL 51

Expert Comment

ID: 13433031
hmm, think you need to ask the apache and PHP developers ...
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.


Expert Comment

ID: 13437356
See this link:

It's not exactly what you want, but hope it help.

LVL 51

Expert Comment

ID: 13438755
php_flag and php_value in httpd.conf do not help 'cause the only change the one mod_php (see my description above)

Author Comment

ID: 13644066
sorry for waiting so long...It seems that what I wanted to do is NOT possible without running php as a cgi.  I was hoping for a better answer :)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question