amiga.org
     
iconAll times are GMT -6. The time now is 03:48 AM. | Welcome to Forum, please register to access all of our features.

Amiga.org Operating System Specific Discussions Other Operating Systems Help! PHP Question

Other Operating Systems This forum is to allow our members to discuss other (non-Amiga-related) operating systems.

Reply
 
Thread Tools Display Modes
Old 02-28-2012, 06:54 PM   #1
Pentad
Technoid
Points: 10,851, Level: 69 Points: 10,851, Level: 69 Points: 10,851, Level: 69
Activity: 11% Activity: 11% Activity: 11%
 
Pentad's Avatar
 
Join Date: Jun 2002
Posts: 286
Unhappy Help! PHP Question

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

<?php
$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);
?>
__________________
2013 15" Macbook Pro Retina * 2.6 GHz QCore * 16 GB RAM, 1TB SSD * Windows 7 Ultimate 64bit via Boot Camp * 3rd Gen 32 GB iPod Touch *Amiga via Emulation (WinUAE in WINE)
Pentad is offline   Reply With Quote
Old 02-28-2012, 07:17 PM   #2
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: Help! PHP Question

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 edited by Piru; 02-28-2012 at 07:21 PM..
Piru is offline   Reply With Quote
Old 02-29-2012, 07:35 AM   #3
Pentad
Technoid
Points: 10,851, Level: 69 Points: 10,851, Level: 69 Points: 10,851, Level: 69
Activity: 11% Activity: 11% Activity: 11%
 
Pentad's Avatar
 
Join Date: Jun 2002
Posts: 286
Default Re: Help! PHP Question

Quote:
Originally Posted by Piru View Post
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
__________________
2013 15" Macbook Pro Retina * 2.6 GHz QCore * 16 GB RAM, 1TB SSD * Windows 7 Ultimate 64bit via Boot Camp * 3rd Gen 32 GB iPod Touch *Amiga via Emulation (WinUAE in WINE)
Pentad is offline   Reply With Quote
Reply

Bookmarks

Tags
php , question

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump