Old:Bugs 3.5-Apollo: config inc php: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | MPG UniCenter || Bugs 3.5-Apollo: [[Bugs 3.5-Apollo: Introduct...)
 
m (BobS moved page Bugs 3.5-Apollo: config inc php to Old:Bugs 3.5-Apollo: config inc php without leaving a redirect)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span id="top"></span>
{{Uc nav 3.5 bugs}}
<div style="padding:0;margin:0; border-bottom:3px inset #000000">
{|
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||
Bugs 3.5-Apollo:
[[Bugs 3.5-Apollo: Introduction | Introduction]] | 
[[Bugs 3.5-Apollo: Server_Start_bat | Server_Start.bat]] | 
[[Bugs 3.5-Apollo: Start_vbs | Disk Start.vbs]] | 
[[Bugs 3.5-Apollo: Close_bat | Close.bat]] |
[[Bugs 3.5-Apollo: config_inc_php | config.inc.php]] |
[[Bugs 3.5-Apollo: apanel blown away | apanel - blown away]] |
[[Bugs 3.5-Apollo: Combined bug fix | Combined bug fix]]
|}
</div>
{| cellpadding="2"
|
__TOC__
||
'''Uniform Server 3.5-Apollo known bugs or issues'''
|}
'''''config.inc.php'''''
'''''config.inc.php'''''


== Bug fix corrects drive letter ==
== Bug fix: corrects drive letter error ==
File: '''config.inc.php'''
File: '''config.inc.php'''
Location: '''*\Uniform Server\udrive\home\admin\www\includes'''
Location: '''*\Uniform Server\udrive\home\admin\www\includes'''


'''Problem:''' In vary rare situations the environment variable “Disk” is not passed to PHP. In this event the script calculates its own path and extracts and uses this disk letter. Unfortunately there is a bug that produces an incorrect drive letter.
'''Problem:''' In vary rare situations the environment variable "Disk" is not passed to PHP. In this event the script calculates its own path and extracts and uses this disk letter. However, there is a bug that produces an incorrect drive letter.


'''Solution:''' Edit the file as follows:
Unfortunately, my original fix introduced a problem when installing The Uniform Server as a service. The following fixes both problems: 
 
'''Solution:'''


{| cellpadding="2" cellspacing="1" style="background:#000000;"
{| cellpadding="2" cellspacing="1" style="background:#000000;"
|- style="background:#e8e8e8;"
|- style="background:#e8e8e8;"
! Change the following: (Line 26):
! Replace this section of code (around line 26):
|- style="background:#f5f5f5;"
|- style="background:#f5f5f5;"
| $drive="$pathArray[0]/$pathArray[1]";
|
|}<br>
<pre style="border:0">
 
$drive = $_ENV['Disk'] . ":";
if($drive == ":"){
$path = realpath(dirname($_SERVER['config.inc.php']));
$pathArray = explode("\\",$path);
$drive="$pathArray[0]/$pathArray[1]";  
}
</pre>
|}
<br>
{| cellpadding="2" cellspacing="1" style="background:#000000;"
{| cellpadding="2" cellspacing="1" style="background:#000000;"
|- style="background:#e8e8e8;"
|- style="background:#e8e8e8;"
! To this:
! With this version:
|- style="background:#f5f5f5;"
|- style="background:#f5f5f5;"
| $drive="$pathArray[0]";
|
|}<br>
<pre style="border:0">
$drive = $_ENV['Disk'] . ":";
if($drive == ":"){
  $path = realpath(dirname($_SERVER['config.inc.php']));
  $pathArray = explode("\\home",$path);
  $drive="$pathArray[0]"; //drive letter and any sub-folders
  $drive=str_replace("\\","/",$drive); //change backslash to forward slash
}
</pre>
|}
 
It splits the path at the "home" folder boundary, so the drive will include all sub-folders.


== Download ==
== Download ==
Its probably quicker to manually correct the file.
Download this file [http://wiki.uniformserver.com/exeload/bugs35apollo/config.inc.php.txt config.inc.php.txt] save it as '''config.inc.phps''' and copy to folder *\Uniform Server\udrive\home\admin\www\includes.


== Forum reference ==
== Forum reference ==
Line 51: Line 53:
[http://forum.uniformserver.com/index.php?showtopic=1400&hl=config\.inc\.php Forum reference 1]
[http://forum.uniformserver.com/index.php?showtopic=1400&hl=config\.inc\.php Forum reference 1]


[http://forum.uniformserver.com/index.php?showtopic=289&hl=only+bug Forum reference 1]
[http://forum.uniformserver.com/index.php?showtopic=289&hl=only+bug Forum reference 2]


== Proposed solution ==
== Proposed solution ==
See above.
See above.
'''''[[#top | Top]]'''''


----
----
Line 64: Line 64:
|}
|}


[[Category: UniCenter]]
 
[[Category: Support]]
[[Category: Archive]]
[[Category: Patches]]
[[Category: Troubleshooting]]

Latest revision as of 12:28, 21 June 2013

Uniform Server 3.5-Apollo known bugs or issues.

config.inc.php

Bug fix: corrects drive letter error

File: config.inc.php Location: *\Uniform Server\udrive\home\admin\www\includes

Problem: In vary rare situations the environment variable "Disk" is not passed to PHP. In this event the script calculates its own path and extracts and uses this disk letter. However, there is a bug that produces an incorrect drive letter.

Unfortunately, my original fix introduced a problem when installing The Uniform Server as a service. The following fixes both problems:

Solution:

Replace this section of code (around line 26):
$drive = $_ENV['Disk'] . ":";
if($drive == ":"){ 
 $path = realpath(dirname($_SERVER['config.inc.php'])); 
 $pathArray = explode("\\",$path); 
 $drive="$pathArray[0]/$pathArray[1]"; 
}


With this version:
$drive = $_ENV['Disk'] . ":";
if($drive == ":"){ 
  $path = realpath(dirname($_SERVER['config.inc.php'])); 
  $pathArray = explode("\\home",$path); 
  $drive="$pathArray[0]"; //drive letter and any sub-folders 
  $drive=str_replace("\\","/",$drive); //change backslash to forward slash
}

It splits the path at the "home" folder boundary, so the drive will include all sub-folders.

Download

Download this file config.inc.php.txt save it as config.inc.phps and copy to folder *\Uniform Server\udrive\home\admin\www\includes.

Forum reference

Additional information or background can be found on these forum pages.

Forum reference 1

Forum reference 2

Proposed solution

See above.


Ric