Web Weather > Weather Website PHP/AJAX scripting
Ajax Website Not Updating
Hfcomms:
Hmmm....
I noticed that my host has a php5 conversion going on with all it's servers and apparently mine was updated within the last 24 hours which is when I started having my problems. I came accross this on one of their help boards.
Question
--- Quote ---Originally Posted by varaonaid View Post
what are the "changes" that will be required to be made once the php5 conversion is complete?
--- End quote ---
Answer
--- Quote ---Two possible changes (not necessarily required) for PHP5:
(1) Add the following line to the .htaccess file:
php_flag register_globals on
PHP4 had register_globals on by default, and PHP5 has it off by default. If your script breaks after the upgrade to PHP5 -- it did for one of my clients -- try turning register_globals back on via the .htaccess file. Or better yet, rewrite the script so it doesn't need register_globals.
(2) If you receive the following error message:
"URL file-access is disabled in the server configuration"
it means your script uses URL file-access (allow_url_fopen to On) (include fopen). That worked in PHP4 but not in PHP5 -- again because it's a security risk. You'll need to rewrite the script.
--- End quote ---
Could #1 have any bearing on my little situation here or is the conversion just a coincidence??
TNETWeather:
You SHOULD NOT have any script that requires register globals on. I'm very surprised they stated that... as that is a big security issue... No site should have Register Globals on at all.
# 2 would effect you if you are doing any number of dynamic scripts that fetch data from remote sources (like forecasts, NWS RSS etc... )
For clientraw.txt neither should be effecting that.
Several have suggested that you look at your logs to see what is actually going on.
--- Quote ---Would you mind posting a bit of the log from your realtimeclientrawftp program?
--- End quote ---
Hfcomms:
Thanks Kevin,
Glad to see that won't be an issue. Just an interesting coincidence that the server was upgrading around the time the website pooped out.
--- Quote ---Several have suggested that you look at your logs to see what is actually going on.
--- End quote ---
Yep, I realize that and I will. But I've been at work all evening and won't be home for a few more hours so nothing I can do at the moment. When I get home or tomorrow morning I'll see what the logs are saying and maybe someone can point me in the right direction.
Thanks Again!!
saratogaWX:
--- Quote ---(2) If you receive the following error message:
"URL file-access is disabled in the server configuration"
it means your script uses URL file-access (allow_url_fopen to On) (include fopen). That worked in PHP4 but not in PHP5 -- again because it's a security risk. You'll need to rewrite the script.
--- End quote ---
is really a not a security risk except to poorly written PHP that would allow arbitrary URLs to be fetched (none of the scripts I'm aware of for weather PHP are vulnerable to this exploit). By default in PHP5, the setting for allow_url_fopen is set to OFF (denying the function).
Less knee-jerk hosters realize that the same function of fopen() with an URL is available with fconnect/fget (that is, read contents of an URL into an array for processing), so closing one and not the other makes no sense.
Closing both denies a great deal of functionality to PHP and should be grounds to seek a more enlightened hoster for your website.
I agree with Kevin about register_globals... bad news, and it's good to have that one closed. Your script issue was caused by disallowing fopen() to access URLs.
Have you tried the override in a php.ini in your document root of your website saying
--- Code: ---allow_url_fopen = on;
allow_url_include = on;
--- End code ---
Best regards,
Ken
TNETWeather:
I personally have not run into this yet so I really don't know the answer, but my understanding was that using fopen to access URL's (allow_url_fopen) is blocked in the newer PHP5 versions, but that fopen for a local file was not.
If that is the case, why is he having problems with this. The clientraw file he is accessing should be local, not a URL... right?
BTW... as of earlier this evening, he had no clientraw.txt file when I checked... still doesn't now.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version