It is not possible to upgrade freepbx if the server is behind a proxy server.
The module admin simply reports it is unable to access mirror.freepbx.org.
The following patch is suggested to make online upgrades more flexible and to enable them to work in a variety of network scenarios including behind a proxy server.
The patch would allow freepbx to use the http_proxy environment variable for upgrades.
The patch downloads the upgrade file to a temporary location in the file system using the standard wget command and then opens the file directly from the file system rather than trying to connect directly over the internet. Wget is a standard application available on nearly all systems and support http proxy functions.
the following goes in functions.inc.php in function module_getonlinexml
Index: functions.inc.php
===================================================================
--- functions.inc.php (revision 5723)
+++ functions.inc.php (working copy)
@@ -2129,7 +2129,11 @@
}
//$fn = "/usr/src/freepbx-modules/modules.xml";
$data = @ file_get_contents($fn);
- $module_getonlinexml_error = empty($data);
+ if (empty($data)) {
+ exec("wget -O - $fn 2> /dev/null", $data_arr, $retcode);
+ $data = implode("\n",$data_arr);
+ $module_getonlinexml_error = ($retcode == 0)?false:true;
+ }
$old_xml = array();
$got_new = false;
then these three lines go just before the $headers = get_headers_assoc($url); line
$dl_module = basename($url);
system("wget $url -O /tmp/freepbx/$dl_module");
$url = "/tmp/freepbx/$dl_module";
$headers = get_headers_assoc($url);
This will make proxy and connection issues almost redundant as it uses wget which is much more configurable for the various networks around.