For security reasons, the server does not allow php or other languages to execute the exec command. When you have special requirements for php to execute the exec command on the server, you need to set two places, otherwise, the execution will fail.
For security reasons, the server does not allow php or other languages to execute the exec command. When you have special requirements for php to execute the exec command on the server, you need to set two places, otherwise, the execution will fail.
This article focuses on the windows php environment, and the linux system is not in the scope of discussion.
For security reasons, the server does not allow php or other languages to execute the exec command. When you have special requirements for php to execute the exec command on the server, you need to set two places, otherwise, the execution will fail.
1. Modify php. ini
Find the php configuration file php. ini. If the php environment is configured, the file is in the directory C: \ WINDOWS.
Search for "disable_functions" in the file, find it, remove "exec" and "shell_exec", and save the file.
2. modify attributes of the cmd.exe File
Go to C: \ WINDOWS \ system32, find the cmd.exe file, right-click-> properties, and add the Internet Guest account in "security" Settings, that is, the IUSR _ ****** account, then grant "read and run" and "read" permissions.
In this way, php can execute the exec command on the server.