Help with php and different ports on CentOS

  • rdx321
  • Born
  • Born
  • No Avatar
  • Joined: Aug 23, 2011
  • Posts: 3
  • Status: Offline

Post August 23rd, 2011, 1:45 pm

Guys, I'm having an issue with php when ever it uses a different port.

For example, I have a curl function on a php script, the function works fine as long as the port for the connection is 80, when I change it to a different port, it doesn't work. Even though I have open both the tcp in & out for that port on the CSF firewall.

When I do a curl command in the linux shell with that same port, it works..


It's also happening with a whois script that I have, the script queries the whois server on port 43, I have open the port on CSF and when I use whois on the linux shell, it works just fine.

For some reason, php can't make any connections outside of port 80.

Do any of you guys have an idea of what can be preventing php from making connections outside port 80?


I have, CentOS 5.6, Apache 2.2.3 and PHP 5.2.10
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 23rd, 2011, 1:45 pm

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post August 23rd, 2011, 10:45 pm

http://centos.org/modules/newbb/viewtop ... 2&forum=43

haha found your other post while searching for some doc's for ya, i will keep looking :P
  • rdx321
  • Born
  • Born
  • No Avatar
  • Joined: Aug 23, 2011
  • Posts: 3
  • Status: Offline

Post August 24th, 2011, 4:07 am

Lol. I'm going crazy with this. I have been trying to find out what's causing this for two days already. It's been driving me crazy..
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post August 24th, 2011, 4:21 am

have not found much and with my lack of linux know how i am sure iptables config the access, there is a new nix addicts here i am sure one will read it within the next 24 hours.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Joined: Jan 23, 2004
  • Posts: 2673
  • Loc: Somewhere outside the box in Sarasota, FL.
  • Status: Offline

Post August 24th, 2011, 11:12 am

Why not make php exec a shell command using shell_exec?
"It's always a long day, 86,400 won't fit into a short."
  • rdx321
  • Born
  • Born
  • No Avatar
  • Joined: Aug 23, 2011
  • Posts: 3
  • Status: Offline

Post August 24th, 2011, 11:23 am

Thanks for the help guys, but i finally figured it out, a user on a different forum helped me out with it. It was actually selinux that was causing the problem.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 64 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.