Warning- escapeshellcmd()


I have a subdomain in this webhost, and when i want to register an account to my page, it shows this error “Warning: escapeshellcmd() has been disabled for security reasons”. when i use my website to localhost it doesn’t make this error.
I want this function to be enabled during the request

How can i fix that? I don’t want to let this error and make it not showable at the user but i want to fix the issue


It says this for a reason, escapeshellcmd() is disabled on our platform (along with just about every other shared hosting platform in existence) for security purposes. This function is often used by hackers and other unauthorized persons to execute commands on the server that a site is hosted on and this is often disallowed.

If you absolutely need to use this function for your site, your only option is to upgrade to a VPS.


What commands are you looking to run? There are often PHP equivalents for Unix commands, and they will sometimes work fine, even on shared hosting.


I want to register a new user, and when i click the register button this warming is showed up, but the register is already done successfully. I want to let the system be able to use this feature and not disable this. This feature let me sent email to users.


That doesn’t answer my question :smile:

Do you know what the command is doing? I am going to guess that you’re trying to send a registration email, and that you’re using PHPMailer or some other email library, and you’ve set it to use Sendmail. Is this right?

Sendmail needs to run system commands to work, so it won’t work on 000webhost.


Yes you are right, i don’t know the commands very well . I don’t use “Sendmail” but just “mail”. Can i use this function on other hosts?


Ah right, the mail() command might connect to Sendmail in the background. mail() is terrible anyway - I suggest you use a proper library.

You can still send email from 000webhost - you can use something like PHPMailer or SwiftMailer and configure an external SMTP provider, like Gmail. It depends on what software you are using, and how comfortable you are with configuring things.


Thank you very much for your answers, I appreciate it and i will see to make these configuration that you told to me. Can you tell me if i am able to use this function on other hosts?


Free hosts usually switch it off for security reasons. Some non-free shared hosts will allow you to use it - Sendmail is a very popular way to send email, so they have to. If you want your software to work, check the phpinfo() of a prospective host - it will tell you what functions are disabled.