PDA

View Full Version : fsockopen problen



Habtopia
26-11-2008, 03:38 PM
ok so i posted about my stats not working because of fsockopen and was told to contact my host and ask them to enable the responce i got was this...



When you install some PHP products such as osCommerce, you may be faced with a 'register_globals' error such as the following:

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

The documentation that accompanies your PHP product may suggest you request your web hosting provider to turn on 'register_globals' for the entire server. This is simply not safe for all users.

You can, however, enable it for your hosting account by doing the following:



Download the file .htaccess from your public_html directory by FTP
Edit the file in a text editor such as notepad and search for the following line:
php_value register_globals 1
Remove the # at the beginning of the line
Save and upload the file back to the directory you originally found it

If the line # php_value register_globals 1 is not present, simply add the following code on a new line and upload the .htaccess file back to the server:
php_value register_globals 1

This should resolve the 'register_globals' problem



Only problem is my .htaccess file has nothing in ? lol

Jam-ez
26-11-2008, 06:03 PM
If the line # php_value register_globals 1 is not present, simply add the following code on a new line and upload the .htaccess file back to the server:
php_value register_globals 1

Explains your problem...?

Habtopia
27-11-2008, 03:02 AM
Explains your problem...?


Have tried this already and didnt work, ty tho.

Dentafrice
27-11-2008, 03:37 AM
Don't turn register globals on.. you don't need it.. that has nothing to do with the fsockopen problem.

I don't see what osCommerce has anything to do with it either.

What's the error/problem you get with your stats?

Habtopia
27-11-2008, 05:49 PM
Don't turn register globals on.. you don't need it.. that has nothing to do with the fsockopen problem.

I don't see what osCommerce has anything to do with it either.

What's the error/problem you get with your stats?

this is the error..



Warning: fsockopen() [function.fsockopen (http://habtopia.co.uk/function.fsockopen)]: unable to connect to shoutcast.mr-host.com:8036 (Connection timed out) in /home/habjay/public_html/radio_stats.php on line 12
Habtopia radio Radio Is Currently Offline

Doritos
27-11-2008, 10:31 PM
this is the error..



That has nothing to do with register globals mate :P

It's just PHP telling you it can't connect to the server..

find fsockopen and change it to @fsockopen

keep the @ symbol.

stops the error.

Habtopia
28-11-2008, 02:16 PM
That has nothing to do with register globals mate :P

It's just PHP telling you it can't connect to the server..

find fsockopen and change it to @fsockopen

keep the @ symbol.

stops the error.

there is no error in the file as it works fine on other hosting accs,
i will try what you said anyway, thanks.

Doritos
28-11-2008, 06:34 PM
there is no error in the file as it works fine on other hosting accs,
i will try what you said anyway, thanks.
Other hosts might be setup to not display the error. That's the problem with moving around share hosting enviroments.

Just try what I said, and see if it suppresses the error.

Tomm
28-11-2008, 08:59 PM
Adding @ does not stop the error, only `silences` it. If you say that the script works fine on other server then I recommend you contact you host again as they gave you something that is completely unrelated to the problem that you are experiencing.


That has nothing to do with register globals mate :P

It's just PHP telling you it can't connect to the server..

find fsockopen and change it to @fsockopen

keep the @ symbol.

stops the error.

iUnknown
29-11-2008, 08:03 PM
For the sake of your question, all you would do if it has nothing in it is add:


php_value register_globals 1

That's all you need to do. That will turn register_globals on for your entire webhosting, or, if you create a new .htaccess file in a single directory only (directory with stats in), and only add that line to this .htaccess, it will only turn register_globals on for that directory.

But, that has nothing to do with your problem. I wrote a detailed thread that covers almost all problems with radio statistics:

http://www.habboxforum.com/showthread.php?t=513298

The bit you want to focus on is step 4:


4. The radio statistics script connects to the server that the SHOUTcast is on through the port that the SHOUTcast is on. You need to make sure that this port is unblocked on BOTH servers (the one with the hosting that the radio statistics are on and the one hosting the SHOUTcast), (getting technical: inbound data and outbound data) for this to work. If you can connect to it to broadcast on it then it means that your SHOUTcast host has their firewall correctly configured, so you need to contact the host that is hosting the radio statistics script to unblock these ports on the firewall. They may also need the IP to allow the IP through the firewall, depending on what types of firewall they have.

Right, if you have a crappy host who didn't even know they have a firewall and don't know what a VPS stands for, give them these instructions:

Connect on SSH
Enter the following stuff (without the # or space after it)
# setup
Now press down on your keyboard and enter
Now press down, down, right right on your keyboard and press enter
Now press down 12 times on your keyboard and press right a few times until it goes to the end of whatever the first thing is there, eg text:tcp or 1234:tcp
Press space twice than left (so you're in a space where theres a space either side)
Now type the SHOUTcast port followed by :tcp
eg. 8000:tcp
Press down then enter.
Press down, down, right, then enter.
Then go to quit or just quit whatever you are on on to connect to SSH.

If they don't know how to connect to SSH then I seriously suggest you move host. These steps may sound silly but they should be clear if you're actually doing it, and it is easier than saying click bla bla because the interface is a bit weird.

Mr-Host should know how to do this, if you've already contacted them about your radio stats then I find it quite funny that I'm giving support for something that they should really know. Although, if the people who provide your web hosting don't know this either, they're just as bad.

Hope this solves your issue.

Seads
30-11-2008, 01:03 AM
I had this error, also with radio stats but it was sorted with my host enabling it.

Habtopia
08-12-2008, 05:01 PM
For the sake of your question, all you would do if it has nothing in it is add:


php_value register_globals 1

That's all you need to do. That will turn register_globals on for your entire webhosting, or, if you create a new .htaccess file in a single directory only (directory with stats in), and only add that line to this .htaccess, it will only turn register_globals on for that directory.

But, that has nothing to do with your problem. I wrote a detailed thread that covers almost all problems with radio statistics:

http://www.habboxforum.com/showthread.php?t=513298

The bit you want to focus on is step 4:



Mr-Host should know how to do this, if you've already contacted them about your radio stats then I find it quite funny that I'm giving support for something that they should really know. Although, if the people who provide your web hosting don't know this either, they're just as bad.

Hope this solves your issue.


Thanks for your help dude, the problem wasnt with mr-host or whoever the radio is with because only the radio is hosted by them, my host has now allowed the port i needed :)

Want to hide these adverts? Register an account for free!