PHP template configuration and actions

4 posts / 0 new
Last post
#1 Tue, 06/02/2009 - 08:27
fatbear

PHP template configuration and actions

Suppose I have the file /etc/php.ini to have additional lines such as:

eaccelerator.cache_dir="${HOME}/tmp/eaccelerator"

Two questions:

  1. When a new server is created, will this correctly be changed to something like the following?
eaccelerator.cache_dir="/home/account/domains/mydomain.com/tmp/eaccelerator"
  1. When a new server is created, I need to do:
mkdir "${HOME}/tmp/eaccelerator"

and I also need to ensure that the UID and GID for that directory is set correctly. Can this be done? If so, how?

Sun, 06/07/2009 - 07:57
andreychek

<div class='quote'>1. When a new server is created, will this correctly be changed to something like the following?</div>

If you want to be able to use variables in the php.ini file, then you'd want to use the PHP template option in System Settings -&gt; Server Templates -&gt; Apache Website called &quot;Template PHP 5 configuration file&quot;.

Using that supports variables.

<div class='quote'>mkdir &quot;${HOME}/tmp/eaccelerator&quot;
and I also need to ensure that the UID and GID for that directory is set correctly. Can this be done? If so, how?</div>

Hmm, I suspect you'll want to create a script for this -- which you can have Virtualmin call when creating a Virtual Server.

You can take a look at System Settings -&gt; Module Config -&gt; Actions upong user and server creation -- &quot;Command to run after making changes to a server&quot;.
-Eric

Sun, 06/07/2009 - 07:57
andreychek

<div class='quote'>1. When a new server is created, will this correctly be changed to something like the following?</div>

If you want to be able to use variables in the php.ini file, then you'd want to use the PHP template option in System Settings -&gt; Server Templates -&gt; Apache Website called &quot;Template PHP 5 configuration file&quot;.

Using that supports variables.

<div class='quote'>mkdir &quot;${HOME}/tmp/eaccelerator&quot;
and I also need to ensure that the UID and GID for that directory is set correctly. Can this be done? If so, how?</div>

Hmm, I suspect you'll want to create a script for this -- which you can have Virtualmin call when creating a Virtual Server.

You can take a look at System Settings -&gt; Module Config -&gt; Actions upong user and server creation -- &quot;Command to run after making changes to a server&quot;.
-Eric

Sun, 06/07/2009 - 07:57
ronald
ronald's picture

the correct variable is like so, this is my working example for open_basedir
open_basedir = $HOME:$HOME/tmp:/usr/lib/php:/usr/share/pear so without the {}

then i saved it as php.ini.virtualmin and told the server templates to use that ini file. In the past with an update the php.ini file was overwritten.

mkdir &quot;${HOME}/tmp/eaccelerator&quot;
isn't this were the /etc/skel comes in?

Topic locked