Home >Backend Development >PHP Tutorial >The solution to the failure of executeupdate php to execute the exec command on the server

The solution to the failure of executeupdate php to execute the exec command on the server

WBOY
WBOYOriginal
2016-07-29 08:48:101258browse

Preface: This article is aimed at the Windows PHP environment, and the Linux system is not within the scope of discussion.

For security reasons, the server does not allow PHP or other languages ​​to execute exec commands. When you have special needs for PHP to execute exec commands on the server, you need to set two places, otherwise the execution will not be successful.

1. Modify php.ini

Find the php configuration file php.ini. If you use the extraterrestrial php automatic installation program to configure the php environment, this file is in the C:WINDOWS directory.

 Search for "disable_functions" in the file, find it, remove "exec" and "shell_exec", and then save the file.

 php在服务器执行exec命令失败的解决方法

2. Modify the cmd.exe file properties

Enter C:WINDOWSsystem32, find the cmd.exe file, right-click -> Properties, add the Internet guest account in the "Security" settings, which is IUSR_*** ***That account, and then grant "Read and Run" and "Read" permissions.

After setting up like this, php can execute the exec command on the server.

The above introduces the solution to the failure of executeupdate php to execute the exec command on the server, including the content of executeupdate. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn