Php scripts not work without sudo

ganfi

New member
Joined
Jul 18, 2024
Messages
8
I installed php 8.2 and use php-fpm8.2.
So if I try to execute script with stream_socket_client function or another they'll return error. But if I connect to server via ssh and try to execute this script via terminal and sudo - all is work.
Why does it happen ?
 
I forgot to add sceenshoot
 

Attachments

  • Screenshot 2024-07-18 at 17.58.10.png
    Screenshot 2024-07-18 at 17.58.10.png
    78.5 KB · Views: 18
this cause by csf firewall option "SMTP_BLOCK=ON".

you need to disable this option
...and disable csf in custombuild to prevent enable again when updating directadmin.
 
this cause by csf firewall option "SMTP_BLOCK=ON".

you need to disable this option
...and disable csf in custombuild to prevent enable again when updating directadmin.
I use external SMTP service like gmail
 
maybe something is wrong with my php-fpm config ?
 

Attachments

  • Screenshot 2024-07-18 at 18.32.42.png
    Screenshot 2024-07-18 at 18.32.42.png
    248.5 KB · Views: 18
I'm not talking to fixed your external service, just re-read again or google search "what's is csf firewall"
 
ok... maybe something other rules blocked that's external server.

try searching block list.
Code:
csf -g "external server IP Address"

if still not found anything, just disable csf and re-check connection again
Code:
csf -x

re-enable with "csf -e"
 
More information between "root" amd normal user.

"root" can create connection without blocking from csf firewall even if there have some block rules.

Normal user will strict with firewall rules.
 
ok... maybe something other rules blocked that's external server.

try searching block list.
Code:
csf -g "external server IP Address"

if still not found anything, just disable csf and re-check connection again
Code:
csf -x

re-enable with "csf -e"

This command return - No matches found

But if I disable csf all is work
 
yeah, I don't know what's the rules cause issued. Hire someone checking directly to your server is good idea.

because port 25, 465, 587 already enable by default, you might need to confirm in option "TCP_OUT", "TCP6_OUT".


Also, are you sure only this external connection have problem ?, gmail or hotmail working normally ?
 
yeah, I don't know what's the rules cause issued. Hire someone checking directly to your server is good idea.

because port 25, 465, 587 already enable by default, you might need to confirm in option "TCP_OUT", "TCP6_OUT".


Also, are you sure only this external connection have problem ?, gmail or hotmail working normally ?

So it happens for any email service - gmail, mail trap and etc
 
Back
Top