[Labs-l] Connecting to MySQL in PHP

Maximilian Doerr maximilian.doerr at gmail.com
Wed Jun 18 00:22:51 UTC 2014


Oh god.  Please don't move the directories around. :p

Gesendet von Maximilian's iPad. 
(Sent from Maximilian's iPad.)

> On Jun 17, 2014, at 20:11, Tim Landscheidt <tim at tim-landscheidt.de> wrote:
> 
> Emilio J. Rodríguez-Posada <emijrp at gmail.com> wrote:
> 
>> $_SERVER["HOME"] is undefined. I just used
>> parse_ini_file("../replica.my.cnf");
> 
>> [...]
> 
> If you want to "totally future-proof" your script, you could
> also use (rephrased from
> https://wiki.toolserver.org/view/Database_access#PHP):
> 
> | $userinfo = posix_getpwuid(posix_getuid());
> | $homedir  = $userinfo['dir'];
> 
> This will always return the home directory of the account
> the script is running as.  However, if we would ever decide
> to move the home directories around, you could probably not
> miss the pandemonium :-).
> 
> Tim
> 
> 
> _______________________________________________
> Labs-l mailing list
> Labs-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l



More information about the Labs-l mailing list