You can use a script like this to change the existing time zones in the php.ini's. Dont forget to change the default for that id. As dash sayd: you can use the --list command to find what php versions are installed and what id they have.
<?php
$hosts = "/var/www/vhosts/system";
$pwfile = "/etc/psa/.psa.shadow";
$pw = trim(file_get_contents($pwfile));
mysql_connect("localhost","admin", $pw);
mysql_select_db("psa");
if (!($result=mysql_query("select name from domains, hosting where domains.id = hosting.dom_id and hosting.
php_handler_id = 'ID_YOU_WANT_TO_CHANGE';"))) {
print("MySQL error: " . mysql_error());
}
$aantal = mysql_num_rows($result);
for ($r = 0; $r < mysql_num_rows( $result); $r++) {
$row = mysql_fetch_array ($result);
$domain = $row[name];
// $domain = "YOURTESTDOMAIN.com";
if (is_file("$hosts/$domain/etc/php.ini")) {
echo ("\n\nfound: $hosts/$domain/etc/php.ini\n\n");
$lines = file ("$hosts/$domain/etc/php.ini");
$conf="";
$confbak="";
foreach ($lines as $line_num => $line) {
$conf = $conf . $line;
}
$hconfbak = fopen ("$hosts/$domain/etc/php.ini.bak", "w+");
fputs ($hconfbak, $conf);
$conf .= "\nadd this line\nanother line\na 3rth line\n";
echo $conf;
$hconf = fopen ("$hosts/$domain/etc/php.ini", "w+");
fputs ($hconf, $conf);
fclose($hconfbak);
fclose($hconf);
} else {
echo ("SOMETHING IS WRONG: $hosts/$domain/etc/php.ini\n");
}
}
?>
If you already have an entry and you want to change it, you need to replace
$conf .= "\nadd this line\nanother line\na 3rth line\n";
by
$conf=str_replace ("search for", "replace with", $conf);
disclaimer: this is an existing script we use to change vhost.conf file changed for php.ini on the fly. It is possible i missed something, you need to test is for yourself on a testdomain.
hope this helps
regards
Jan