6.0.0-beta1
7/16/25

[#10758] horde-db-migrate and virtual
Summary horde-db-migrate and virtual
Queue Horde Base
Queue Version 4.0.11
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester dom.lalot (at) gmail (dot) com
Created 11/14/2011 (4993 days ago)
Due
Updated 11/30/2011 (4977 days ago)
Assigned 11/14/2011 (4993 days ago)
Resolved 11/30/2011 (4977 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/30/2011 01:21:53 PM Jan Schneider State ⇒ Resolved
 
11/30/2011 01:21:49 PM Git Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

Add note how to set the vhost when running CLI scripts (Bug #10758).

  1 files changed, 4 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/e20ff021bef930e37f3a2401443e7e4226e90c7b
11/15/2011 07:31:33 AM dom (dot) lalot (at) gmail (dot) com Comment #9 Reply to this comment
Try that.
Hello Jan,

That's fine! Thank you

Dom
11/14/2011 05:04:11 PM Jan Schneider Comment #8
Assigned to Jan Schneider
Reply to this comment
Try that.
11/14/2011 05:03:54 PM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

[jan] Don't overwrite $_SERVER superglobals unconditionally, to allow 
setting them through environment variables (Bug #10758).

  2 files changed, 14 insertions(+), 6 deletions(-)
http://git.horde.org/horde-git/-/commit/6701ae30b684b1533f4aed06d38fd6777e47f410
11/14/2011 04:57:02 PM Jan Schneider Comment #6 Reply to this comment
Ah right, we explicitly set $_SERVER['SERVER_NAME'] to '127.0.0.1' in 
Horde_Cli::init().
11/14/2011 04:49:36 PM dom (dot) lalot (at) gmail (dot) com Comment #5 Reply to this comment
How about if you put some
var_dump($GLOBALS['conf']['server']['name']);
in horde-db-migrate after the appInit() call? Does it output the 
correct server name?
root@horde4:/var/www/horde/config# export SERVER_NAME=etumeltest.univmed.fr
root@horde4:/var/www/horde/config# /usr/bin/horde-db-migrate
string(9) "127.0.0.1"

dig gives:
;; ANSWER SECTION:
etumeltest.univmed.fr.  86400   IN      CNAME   horde4.univmed.fr.

Apache:
<VirtualHost *:80>
         ServerAdmin webmaster@localhost
         ServerName horde4.univmed.fr
         ServerName etumeltest.univmed.fr
..
conf.php:
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];

/etc/hosts
root@horde4:/var/www/horde/config# cat /etc/hosts
127.0.0.1       horde4.univmed.fr horde4 localhost

nothing to tell that etumeltest is 127.0.0.1

Strange!

11/14/2011 03:58:36 PM Jan Schneider Comment #4 Reply to this comment
How about if you put some
var_dump($GLOBALS['conf']['server']['name']);
in horde-db-migrate after the appInit() call? Does it output the 
correct server name?
11/14/2011 03:51:26 PM dom (dot) lalot (at) gmail (dot) com Comment #3 Reply to this comment
Sounds like there is something wrong with your PHP. Try this on the 
command line:

SERVER_NAME=etumeltest.univmed.fr php -r 'echo $_SERVER["SERVER_NAME"];'

This should output "etumeltest.univmed.fr".
root@horde4:~# SERVER_NAME=etumeltest.univmed.fr php -r 'echo 
$_SERVER["SERVER_NAME"];'
etumeltest.univmed.frroot@horde4:~#

seems OK in php

root@horde4:/var/www/horde/config# php5 -v
PHP 5.3.6-13ubuntu3.2 with Suhosin-Patch (cli) (built: Oct 13 2011 23:09:42)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
     with XCache v1.3.2, Copyright (c) 2005-2011, by mOo

And conf-etumeltest.univmed.fr.php contains a different database:

$conf['sql']['socket'] = '/var/run/mysqld/mysqld.sock';
$conf['sql']['protocol'] = 'unix';
$conf['sql']['database'] = 'hordeetud';
$conf['sql']['charset'] = 'iso-8859-1';

11/14/2011 03:29:06 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Sounds like there is something wrong with your PHP. Try this on the 
command line:

SERVER_NAME=etumeltest.univmed.fr php -r 'echo $_SERVER["SERVER_NAME"];'

This should output "etumeltest.univmed.fr".
11/14/2011 07:40:33 AM dom (dot) lalot (at) gmail (dot) com Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ horde-db-migrate and virtual
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Hello,

I am trying to get horde-db-migrate working with virtual. I followed 
Jan advice:
export SERVER_NAME=etumeltest.univmed.fr
Then horde-db-migrate on a new fresh import from horde3 and nothing happens

/var/www/horde/config
-rw-r--r--  1 root     root      6512 2011-09-09 15:38 
conf-etumeltest.univmed.fr.php
conf.php:
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['server']['port'] = $_SERVER['SERVER_PORT'];


The virtual is OK if I change manually conf.php then migrate. But I 
can stay like this in production!

That's probably something I missed?

Dom

Saved Queries