Wednesday, October 31, 2007

How to solve the connection refuse error for php script on Linux

I am trying to use Magpie RSS parser to parse RSS feed in my PHP scripts today. However, I always got 'unable to connect to www.google.com:80 (Permission denied)' error messages.

In php.ini, the allow_url_fopen is set to on.
Then it must has something to do with my Apache or network configurations.

After fighting for one hour, I finally found the problem that it was disabled by my network policy.
To fix this, Desktop > System > Administration > Security Level > SELinux > httpd > check the HTTPD scripts to connect to the network.