NameSilo

Is allowing exec() function safe?

Spaceship Spaceship
Watch

cancer10in

Established Member
Impact
0
Hello Webhosters!


Do you think its safe to allow the PHP function exec() on a shared server?

If yes, why?

If No, why?


Plz explain.


Thanx in advance
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
It is not safe. The reason is it will allow to execute commands. If some vulnerable commands are executed it will cause security issues.
 
0
•••
How do you diasllow system functions (like exec() system() etc ) in php.ini?
 
0
•••
cancer10in said:
Do you think its safe to allow the PHP function exec() on a shared server?

You'll need to think about what you mean by "safe" to get a sensible answer. Disallowing exec may restrict your hosting customers. Allowing exec may allow vulnerabilities to be exploited. Any hosting provider needs to strike a balance between the two.

IMO allowing exec in itself is not unsafe. If you allow cgi-bin scripts, then allowing exec is pretty much the same thing (there is no way to prevent a perl script from doing the same thing as PHP exec). You should depend on other security measures (such as file permissions) to prevent access of sensitive information (e.g. other users' home directories) on the server. I always configure PHP and cgi in su mode on shared servers, so allowing PHP exec is not a problem.
 
0
•••
qbert220 said:
I always configure PHP and cgi in su mode on shared servers, so allowing PHP exec is not a problem.


How do I do that on my server?
 
0
•••
0
•••
You need to involve additional measures to protect the server and you will need to be sure about all people hosted there
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back