Miscellaneous ⇒ Server Chat ⇒ Setting fsockopen ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexServer Chat

Setting fsockopen Reply to topic


hello, i am trying to get this to work but also getting fsock problem
this is on my own server, running fedora core

i tried making a php file and running it

<?php $fp = fsockopen('localhost', 80, $errno, $errstr, 10); if (!$fp) { echo "ERROR: $errno - $errstr<br />\n"; } else { echo "connected"; } fclose($fp); ?>

and it gives me error when accessing it from website, but going from commandline php -f index.php (this file) it shows connected

then i did this, to hope to open output
and my php.ini also has allow_url_somethingidontremember on

iptables -A OUTPUT -p TCP --dport 80 \
-m state --state NEW -j ACCEPT


any help is greatly appreciated

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
fedora core 4/mysql 4.1.11/php 5.0.4/dragonfly 9.0.6.1


@TMKF_Patryk: got PHP running is safe mode?

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


TMKF_Patryk wrote
then i did this, to hope to open output
and my php.ini also has allow_url_somethingidontremember on

any help is greatly appreciated


Strange to have fsockopen closed but allow_url_fopen on.
Your host blocks one remote connect system but, keeps the less secure other version wide open!

allow_url_fopen is nastier in security terms then fsockopen, sounds like a hosting provider that doesn't understand what he's doing.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


allow_url_fopen is nastier in security terms then fsockopen, sounds like a hosting provider that doesn't understand what he's doing.


thats me... i had it open to try and get fsockopen to work

@TMKF_Patryk: got PHP running is safe mode?


i just checked the php.ini file and safemode is off

i am honestly not sure whats wrong. For now I made it that you can upload avatar so thats fine.I wonder if this has anything to do with people having issue getting the e-mail confirmation

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
fedora core 4/mysql 4.1.11/php 5.0.4/dragonfly 9.0.6.1


TMKF_Patryk wrote
this is on my own server

If you getting "function disabled for security reasons" warning double check disable_functions in your php.ini ...

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head


yea i forgot to mention i checked that, its off Smile
was checking iptables again, everything seems to be working, I remember seeing a conf file with ports, not sure if it was this server or other though...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
fedora core 4/mysql 4.1.11/php 5.0.4/dragonfly 9.0.6.1


also i turned off iptables, still no go, not quite sure what the problem is :/

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
fedora core 4/mysql 4.1.11/php 5.0.4/dragonfly 9.0.6.1


well, i fixed it (or for now atleast)

incase anyone else is a noob like me and needs fix:
setsebool -P httpd_can_network_connect 1

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
fedora core 4/mysql 4.1.11/php 5.0.4/dragonfly 9.0.6.1


Right .. selinux not permissive ... I use permissive to train a server, then when all seems to be ok I enforce it.

Well done Patryk!

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.7 / PHP 7.3 / head

All times are UTC


Jump to: