Manual talk:$wgScriptPath

Latest comment: 7 years ago by 2003:72:6D2C:2A00:3105:BC0F:227A:92D3 in topic Dependencies

Wasn't expecting this to be hard-coded, and it cost me a good deal of time when I moved my wiki. $wgScriptPath = dirname($_SERVER["SCRIPT_NAME"]); is a better DefaultSettings.php default than '/wiki'. Gherson 03:16, 14 December 2011 (UTC)Reply

Other variables depend on this one - but which variables?

edit

I wish it went into more detail about exactly which variables need changing. —71.197.220.208 07:06, 17 January 2012 (UTC)Reply

Dependencies

edit

Note: A lot of other variables are defined relative to this one. If you redefine this in your LocalSettings.php then all dependent variables will need redefining too!

I wonder if that's true today. Most things seem to be defined like $wgSomething = "{$wgScriptPath}/something"; so they don't need a manual override. --Tgr (talk) 23:41, 25 December 2015 (UTC)Reply

I thought the same. This sentence at least was unclear. I have just modified it a bit. If kept unchanged, the dependent variables will be redefined automatically - however, checking if the result is what is wanted, never is wrong. --2003:72:6D2C:2A00:3105:BC0F:227A:92D3 07:09, 16 July 2017 (UTC)Reply

Is a directory name really legit here?

edit

Parsoid and OCG assume that $wgScriptPath is a virtual path on the server, not an on-disk filesystem path. $wgScriptPath is used to form $wgArticlePath, and we use $wgArticlePath to build URLs to point to articles -- that doesn't work if there are filesystem paths in these variables. Are we doing it wrong? Or is the documentation here out-of-date, and $wgScriptPath should always be a virtual path which can be used to build URLs?

$wgScriptPath is definitely the URL path, not the filesystem path, and it can be used to build URLs. $IP is the filesystem path referring to the directory that contains index.php and such. Matma Rex (talk) 16:35, 19 April 2016 (UTC)Reply
Return to "$wgScriptPath" page.