Welcome, Guest. Please login or register.

Author Topic: Help! PHP Question  (Read 992 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline PentadTopic starter

Help! PHP Question
« on: February 29, 2012, 01:54:18 AM »
I apologize for this question but I was hoping somebody here but have a suggestion.  I have had a terrible time with Network Solutions and I am very frusterated.

Here is the condensed version of my problem:  I created a site for a client using PHP on another site (go daddy).  The code uses FTP within PHP.  Works great on the other site.  I moved the site over to NS and the FTP portion of the code stopped working.

To remove any complexity to the problem, I wiped my code out and created a single php file that tries to connect to an FTP site, get a dir listing, and log out.  Honestly, that simple (See my code at the end.)

When I run this script on NS I get an error that the operation timed out and the domain name could not be found.  I have tried ftp.funet.fi, ftp.microsoft.com, ftp.networksolutions.com, etc...  No matter what domain name I stick in there it just times out like it can't resolve the name.

Same coded tested on three different hosting sites (go daddy, a plus, etc...) works great.

I called NS and I get this "We don't troubleshoot scripts" but I am not sure what else to try.  They suggestion either the code is bad or the php.ini file is bad.  So I look at their temp php.ini file which seems fine, I also copy the same php.ini file from the other sites to test in series to see if that works.  Nothing changes, it times out like it can't resolve the name.

So, I replace the name with the IP addresses of different sites (including NS's) same thing.

Can any of you think of something I might have missed?  I teach CS but I would be the first to admit that I do not know everything.  I cannot think of anything else to try given my results with these other hosting sites.

My theory is that there is something on their server that is preventing this from working.  I had to threaten to remove the site, the account, and post my issue on other sites for them to escalate the problem.

I was hoping somebody here might have a suggestion.

Thanks for reading!
-P

$host = 'ftp.funet.fi';
$usr = 'ftp';
$pwd = 'me@here.com';

$conn_id = ftp_connect($host, 21) or die ("Cannot connect to host");

ftp_login($conn_id, $usr, $pwd) or die("Cannot login");
$buff = ftp_rawlist($conn_id, '/');
ftp_close($conn_id);
var_dump($buff);
?>
Linux User (Arch & OpenSUSE TW) - WinUAE via WINE
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Help! PHP Question
« Reply #1 on: February 29, 2012, 02:17:44 AM »
My guess is that they have SELinux enabled. httpd_can_network_connect being enabled would prevent httpd from connecting to any socket.
Quote
SELinux policy can be setup such that httpd scripts are not allowed to connect out to the network. This would prevent a hacker from breaking into you httpd server and attacking other machines.

Another option is that they've completely disabled arbitrary outgoing network traffic (egress filtering).
« Last Edit: February 29, 2012, 02:21:01 AM by Piru »
 

Offline PentadTopic starter

Re: Help! PHP Question
« Reply #2 on: February 29, 2012, 02:35:47 PM »
Quote from: Piru;681842
My guess is that they have SELinux enabled. httpd_can_network_connect being enabled would prevent httpd from connecting to any socket.


Another option is that they've completely disabled arbitrary outgoing network traffic (egress filtering).


Thank you for the help Piru.  I have never been so flustered with doing something so simple.  NS has such a non-helpful support system.

I'm still waiting to hear back from them.  However, I have rewritten my script to not use FTP.  It is less elegant but it work so that is the most important part.  Of course, it sucks if you are linking multiple sites and you want to FTP through ssh.


-P
Linux User (Arch & OpenSUSE TW) - WinUAE via WINE