Page 2 of 2
Posted: Sun Jun 04, 2006 8:13 am
by Chris Corbyn
This seems to be a common problem with the url_fopen stuff. Try using fsockopen() to get the file instead... there was a thread about this recently.
Posted: Sun Jun 04, 2006 8:16 am
by ok
I tested it with PHP4 and it works fine!!!
So, probably you have a server problem such as firewall etc
Posted: Sun Jun 04, 2006 8:18 am
by wildcolour
Hades wrote:I looked at your two phpinfo files and the only real difference I can see other than the obvious php version is that on the new server you have a temp dir defined. On the old php4 server you didn't.
Thanks Hades
I actually only defined the /tmp folder about 10 mins ago. I thought I should make sure it was using that folder and that the permission where fine. and no change.
this has me stumped
I also just tried setting the proxy values in the php.ini file, and still no go either.
I am starting to think it may be time to re-build the server - grrrrrrr I really do not want to do that.
Any other ideas greatly appreciated.
thanks again
Matt

Posted: Sun Jun 04, 2006 8:44 am
by wildcolour
d11wtq wrote:This seems to be a common problem with the url_fopen stuff. Try using fsockopen() to get the file instead... there was a thread about this recently.
thanks d11wtq
Just gave that a go (I swtich errors on for the test) and it returned this
http://www.wildwalks.com/nswobssock.php
Warning: fsockopen() [function.fsockopen]: unable to connect to
http://www.bom.gov.au/products/IDN65188.shtml:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in /var/www/html/wildwalks/nswobssock.php on line 20
Warning: feof(): supplied argument is not a valid stream resource in /var/www/html/wildwalks/nswobssock.php on line 22
But I will switch error reporting off again now. could not find this socket transport "http" thing in the php.ini file do you know what this is??
thanks again
Posted: Sun Jun 04, 2006 8:48 am
by wildcolour
ok wrote:I tested it with PHP4 and it works fine!!!
So, probably you have a server problem such as firewall etc
HUm strange - I have played with proxy settings - when the guy is in the data centre tommorow I think we might try switching off the fire wall and proxy just for a few seconds to test test this - but I don't think that is going to be it, cause I can wget the file.
I don't know
One thing I just noticed that is I think is strange is that my /tmp folder is empty - nothing at all in it. but the permissions are 777 and I have tried changing php.ini to look at /tmp just in case and still no luck
hum
Posted: Sun Jun 04, 2006 8:48 am
by Chris Corbyn
*cough* Leave out the http:// part and just give the server name. If you specify port 80 it should connect fine. You need a fair amount of code to actually download the content but there are some references to it on the php.net page for the documentation and also some threads on this board if you have a search around

Posted: Sun Jun 04, 2006 8:49 am
by Chris Corbyn
wildcolour wrote:One thing I just noticed that is I think is strange is that my /tmp folder is empty - nothing at all in it. but the permissions are 777 and I have tried changing php.ini to look at /tmp just in case and still no luck
hum
Where is /tmp (is it /tmp on te server or /tmp in the web root?)
It needs to be chmodded like so:
chmod u,g,o+rwxt /tmp
Posted: Sun Jun 04, 2006 8:53 am
by wildcolour
d11wtq wrote:wildcolour wrote:One thing I just noticed that is I think is strange is that my /tmp folder is empty - nothing at all in it. but the permissions are 777 and I have tried changing php.ini to look at /tmp just in case and still no luck
hum
Where is /tmp (is it /tmp on te server or /tmp in the web root?)
It needs to be chmodded like so:
chmod u,g,o+rwxt /tmp
thanks d11wtq
I just did that chmod
chmod u,g,o+rwxt /tmp
tmp folder is /tmp on the server (is that bad??)
Posted: Sat Jun 10, 2006 8:36 pm
by derchris
Try to use CURL to open Webpages instead of fopen or fsockopen
Fixed it
Posted: Sat Aug 26, 2006 7:38 am
by wildcolour
Well after all that the problem was selinux - grrrr nothing to do with the php5 upgrade in the end - thanks for your help