Online update problem

Is that me or other people get the Warning Cannot connect to online repository ( Online modules are not available. in RC1 since last night. No error in httpd or any other log. É

I have the same issue with FreePBX. I recently upgraded from 2.2.3 to 2.3.0rc1 to 2.3.0. I believe the problem lies in function module_getonlinexml in /var/www/html/admin/ I removed the @ from the file_get_contents function call on line 1726. After doing so and running /var/lib/asterisk/bin/module_admin listonline from the command line, I get the warning:

PHP Warning: file_get_contents( failed to open stream: HTTP request failed.

What is strange is that I can ping AND I can wget the xml file.

This is usually related to proxy issues. If not and you are using trixbox, I believe they had some problems on their ISO configuration wrt to DNS or something.

Philippe Lindheimer - FreePBX Project Lead
http// - IRC #freepbx

This can also be down to your php configuration.

The method freepbx uses to download the modules file is via a file open command with a url as parameter. A “secure” php configuration will not permit this, so your apache php.ini would need to be modified to allow:

allow_url_fopen = On

I have same problem, i check php.ini , allow_url_fopen = On , but check for update online failed.

Warning: Cannot connect to online repository ( Online modules are not available.

Hello wp1998

The first thing to check is if you can get the file at all - so try


from the freepbx server (swap 2.4 for the main version you are running).

If this works, then it eliminates dns and firewall type causes, so then you may have a permissions issue…

not quite - it does not eliminate content filtering. Sonicwall firewalls are famous for creating this problem when content filtering is enabled, and I assume there are others that also have the problem.

Are you saying that a successful wget of the xml file from the box that runs the script that downloads the same file doesn’t eliminate the firewall as an issue?

How does the sonicwall filewall know that the server is running wget versus a php script?

Because the sonicwall is doing content filtering. It’s looking at the data in context and doesn’t like something that’s happening in context.

Seriously, sonicwall does this a lot. (As do other content filtering systems, but sonicwall is the one that comes up the most.)

Yeah I was aware of the sonicwall issues, but I had figured that PHP and wget would send a similar parameter set with the http get, and both be incomplete compared to a browser doing the request.

So I would have expected the wget to fail in the same way as the php “fopen with url”. Perhaps wget then sends a more complete set of headers if it does work correctly.

Does anyone else have any ideas on this? I have one trixbox 2.4 install that FreePBX will load updates on. Then I tried the PIAF, that one will not update. I can ping the on both. Other than the Ip address, all other network settings are the same. I’m not a Linux person, so I haven’t been able to find the php.ini file. Could somebody shed some light on where I could find it please???


Same problem.

I can download wget and xml file. But cannot use online admin. Any help please?


@Mike: The php.ini is often at /etc/php.ini - try “locate php.ini”

If not, what distribution of linux are you running?


If you aren’t running a Sonicwall firewall, then this can be a permissions thing. Do you know which user your web server is running as?

Thank you Paulkoan. I found it. I went and looked at it in nano, I did find an entry for allow_url_fopen. It was set to On.
This is an install of CentOS 5 from the pbx in a flash cd.

I’m still at a loss on this one.

Hello tabbertmj,

Did you confirm you can do a wget of the file from the command line?


Sorry, forgot to put that in. Yes, I can use wget to download the file manually. I then went back in to FreePBX and tried again. No luck. I think I might try this weekend on another machine to see what the results are.

Hello. Try this. Create a file called test.php in your htdocs directory (this may be at /usr/local/apache/htdocs, it depends on your dist):

$data = file_get_contents("");
echo $data;

Run this from the command line and make sure you get the modules list:

php test.php

Now browse to your freepbx webserver and see if you get the modules list:


Running test.php produced the same error - “PHP Warning: file_get_contents( failed to open stream: HTTP request failed! in /var/www/html/test.php on line 2”

Changing the user_agent in /etc/php.ini solves the problem.
user_agent=“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”

hello thanks for your help.

As per instruction I changed in httpd.config
User asterisk
Group asterisk

When i try your test script I get an empty page.

How do I check what user its running under?

Should I wipe the install and redo everything ?


Hello Roman

If you run

php test.php

from the command line, do you get any errors?