|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
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. |
|
|
#2 | |
|
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:
|
|
|
|
|
|
#3 |
|
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.
|
|
|
#4 |
|
Just tryin' to help
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 |
|
|
|
|
#5 |
|
Just tryin' to help
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 |
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
At least others are having problems, I was afraid my forum DB took a dump (pun intended)
|
|
|
#7 |
|
Just tryin' to help
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 |
|
|
|
|
#8 |
|
Just tryin' to help
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 |
|
|
|
|
#9 |
|
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 |
|
|
|
|
#10 | |
|
Just tryin' to help
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
|
Quote:
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts Got some free time? You can find Nothing of Value @ PrettyWorthless.com |
|
|
|
|
|
#11 |
|
Just tryin' to help
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
|
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts Got some free time? You can find Nothing of Value @ PrettyWorthless.com |
|
|
|
|
#12 |
|
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 |
|
|
#13 |
|
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. |
|
|
#14 |
|
Registered
Join Date: Dec 2004
Location: Tacoma, Washington
Posts: 6
Reputation: 5
|
I have the SAME issue..
|
|
|
|
|
#15 |
|
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 |
|
|
|
|
#16 | |
|
Former Spam Filter (EU)
Join Date: Mar 2004
Location: Washington (THE original UK one!)
Posts: 12,805
Reputation: 470
|
Quote:
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. |
|
|
|
|
|
#17 | |
|
Guest
Posts: n/a
|
Quote:
So, http://www.mysite.com = http://localhost.mysite.com http://mysub.mysite.com = ??? |
|
![]() |
| Thread Tools | |
|
|