php.ini template?

3 posts / 0 new
Last post
#1 Fri, 02/27/2015 - 17:31
Jason at eROI

php.ini template?

Hello,

I tried to set up some php variable in the server_template|apache section, but it didn't seem to make it into a new site I test-created. in this case, I am trying to set open_basedir. on my original apache server, this was set in the apache config with php_admin_value...

I have been able to modify the site-specific php.ini file, but I sure would like to have this done automagically...

I am using php via fastcgi with the pro version of virtualmin.

Can I setup a php.ini template that I can do virtualmin variable substitution in?

Thanks!

--jason

Sat, 02/28/2015 - 10:19
andreychek

Howdy,

What's an example of a variable that you tried putting into the php.ini file?

You can specify a PHP template file in System Settings -> Server Templates -> Default -> Apache Website -> Template PHP 5 configuration file.

In there, it should support variables such as:

${DOM}
${HOME}
Mon, 03/02/2015 - 16:02 (Reply to #2)
Jason at eROI

Hello Andreychek,

Thank you for your reply! I will probably build a custom template file as you suggest.

Having said that, my impressions from the user interface was that entries made into the "PHP configuration variables for scripts" table would be copied into the new php.ini file as a site was created.

Here is a sample of what I tried: I should specify I am converting sites hosted on an ehcp server to virtualmin. the ehcp server runs mod_php, and has several settings embedded into apache's config. It is these entries that I am copying over...

php_admin_value open_basedir "/home//:/usr/share/php:/usr/share/pear" php_admin_value upload_tmp_dir /home///phptmpdir php_admin_value session.save_path /home///phptmpdir php_admin_value mail.log "/var/log/apache-maillog/vhost-.log"

Thus, I tried defining for a new site "open_basedir" Exactly "/home//:/usr/share/php:/usr/share/pear" but the setting didn't propagate anywhere, even when I ran phpinfo().

and were hard-coded entries, rather than templates.

I then tried it with the template info:

"open_basedir" Exactly "/home/${USER}/${DOM}:/usr/share/php:/usr/share/pear"

with still no result.

I can only infer that a) there's a bug or misconfiguration or b) that's not the intended purpose of this data entry.

Topic locked