Are there any alternatives to shell_exec and proc_open in PHP?

强颜欢笑 提交于 2019-12-01 12:32:51
Gordon

I assume you want to use this for async processing, for instance sending eMails in a separate process (hence the error in email.php). If so, please check if cURL is enabled. You can trigger your scripts through an HTTP request without waiting for the response.

Further reading:

If cURL is not available, try to use with non-blocking streams:

For added security, consider using a self-defined API key, so the eMail sending URL cannot be triggered without permission. Pass this in as a GET or POST. You could also validate if the request came from the same server.

The only alternative is to not use shared hosting. They don't want you doing this for a reason.

codaddict

Try using backtick operator

This answers seems to suggest these is not much you can do.

Just a follow up for people who need to use shared hosting. While I no longer recommend HostGator due to their sub-par support (resulting from their purchase by EIG), they do allow popen.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!