PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > PHP
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 12-16-04, 04:53 PM   #1
xemulx
Guest
 
Posts: n/a
PHP: strange problem with file($url)

Help, this has been driving me nuts! I have a script that uses the following line:

$file = file($url);

If I define $url as any one of the existing pages on my POWWEB hosted site the script fails. But if I define $url as a page on another site it works fine. And if I host the exact same script on another non-POWWEB site and define $url as one of the pages on my POWWEB site it also works! To add to my frustration this same script worked fine a couple weeks ago.

I need this script to work on my POWWEB site. Anyone have any idea what could have happened? It seems like it would have to have something to do with how my site is configured on POWWEB but I'm stumped. As far as I know nothing has changed. Any help would be appreciated. Thanks.
 
Old 12-16-04, 05:24 PM   #2
islandtime
Registered
 
Join Date: Nov 2004
Location: Mobile
Posts: 23
Reputation: 5
From the help I have got on the forum you should try one of the following full paths for your url. It has solved similar problems for me. See this sticky thread:http://forum.powweb.com/showthread.php?t=42202

/www/y/yoursite/htdocs/file.html

or

http://localhost.yoursite.com/file.html

Quote:
Originally Posted by det1smc
Oops...
I tried it out, it needs the full path from your server root.

$cache_file = "/tmp/buoydata.".$stationNumber.".cache";
should be
$cache_file = "/www/d/dauphinislandsurf/tmp/buoydata.".$stationNumber.".cache";

assuming that "/www/d/dauphinislandsurf" is your directory. You can check it on the general tab in ops.powweb.com.
islandtime is offline  
Old 12-16-04, 06:36 PM   #3
xemulx
Guest
 
Posts: n/a
Yeah, I'm using the full paths (as in "http://localhost.yoursite.com/file.html") ...the same script wouldn't work from another host pointed at my POWWEB site if I was only using a relative path. Thanks anyway.
 
Old 12-16-04, 07:54 PM   #4
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
It does not work if you use a relative path? Post your code and the url.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-16-04, 09:16 PM   #5
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
php seems to have gone bonkers on the PowWeb servers. I suspect that may be the problem.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-16-04, 09:17 PM   #6
Seawolf
Guest
 
Posts: n/a
At least others are having problems, I was afraid my forum DB took a dump (pun intended)
 
Old 12-16-04, 09:21 PM   #7
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
Been doing testing, and yes the file() functions is definately intermittent. Works then does not when I keep executing the same pages. Mostly does not on my pages.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-16-04, 09:27 PM   #8
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
This is a bummer. I use file() a lot in my php coding as I have all my parms in flat files. Nothing works anymore . . .
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-16-04, 09:30 PM   #9
rnorth6920
 
Join Date: Aug 2003
Location: KY
Posts: 96
Reputation: 5
I dont know if this is related to a problem that I'm having but when i try to access my forum, i just get a blank page. The forum has been running fine forever and i havent changed anything. If i keep refreshing, it eventually comes up, but if i try to go to a different page after that...i get a blank page again.

www.urbanohio.com/forum2
rnorth6920 is offline  
Old 12-16-04, 09:34 PM   #10
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
Quote:
Originally Posted by rnorth6920
I dont know if this is related to a problem that I'm having but when i try to access my forum, i just get a blank page. The forum has been running fine forever and i havent changed anything. If i keep refreshing, it eventually comes up, but if i try to go to a different page after that...i get a blank page again.

www.urbanohio.com/forum2
No way to know for sure until the php problems get fixed. We all just have to be patient and wait.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-16-04, 09:34 PM   #11
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
http://forum.powweb.com/showthread.php?t=44294
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 12-17-04, 01:48 AM   #12
xemulx
Guest
 
Posts: n/a
Thanks. The update doesn't seem to have helped. My script is pretty complex but here's an isolated bit demonstrating the file() problem.

<?php

$url = "http://www.cyberwalker.com/index.html";
$file = file($url);
if($file) {
print $url.": ok<br>";
} else {
print $url.": failed<br>";
}

$url2 = "http://www.craigslist.org";
$file2 = file($url2);
if($file2) {
print $url2.": ok<br>";
} else {
print $url2.": failed<br>";
}

?>

Try the script from POWWEB site and get failed/ok:

http://software.cyberwalker.com/script_test.php

Try the exact same script from another host and get ok/ok:

http://www.zun.com/script_test.php
 
Old 12-17-04, 07:02 AM   #13
gumbysworld
Guest
 
Posts: n/a
read

http://forum.powweb.com/showthread.php?t=44220

What ever they did to mysql7 affected them all. my viewtopic.php file was wiped blank after the test. Check your files close. They may be partly blank or wiped clean.
 
Old 12-21-04, 11:23 AM   #14
revisualize
Registered
 
Join Date: Dec 2004
Location: Tacoma, Washington
Posts: 6
Reputation: 5
I have the SAME issue..
revisualize is offline  
Old 12-22-04, 03:57 AM   #15
HalfaBee
 
HalfaBee's Avatar
 
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 7,266
Reputation: 340
You can't use file() with a url pointing to a site on the same load balancer

Use sever paths, for accessing files on your own site.
Or if you really need to do http calls, use http://localhost.yoursite.com ...
__________________
I don't suffer from laziness, I enjoy every minute!
Edit your php.ini here
http://members.powweb.com/member/cgi...nt/PHPplus.bml
HalfaBee is offline  
Old 12-22-04, 05:03 AM   #16
IanS
Former Spam Filter (EU)
 
IanS's Avatar
 
Join Date: Mar 2004
Location: Washington (THE original UK one!)
Posts: 12,805
Reputation: 470
Quote:
Originally Posted by HalfaBee
You can't use file() with a url pointing to a site on the same load balancer

Use server paths, for accessing files on your own site.
Or if you really need to do http calls, use http://localhost.yoursite.com ...
I'm rather confused here - The problem as I understood it wouldn't be helped by using server paths as the calling server is a remote non-Powweb host.

As I understand the problems discussed here, it is when 2 packages (even if one is a non-Powweb one or not) try to interact with the file() call then a problem occurs.
IanS is offline  
Old 12-28-04, 01:33 PM   #17
xemulx
Guest
 
Posts: n/a
Quote:
Originally Posted by HalfaBee
You can't use file() with a url pointing to a site on the same load balancer

Use sever paths, for accessing files on your own site.
Or if you really need to do http calls, use http://localhost.yoursite.com ...
Ahhh, that helps...does anyone know how you would access a subdomain in this manner?

So,

http://www.mysite.com = http://localhost.mysite.com

http://mysub.mysite.com = ???
 
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:54 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.