Home > Backend Development > PHP Tutorial > Solution to PHP failure to execute exec command on the server_PHP tutorial

Solution to PHP failure to execute exec command on the server_PHP tutorial

WBOY
Release: 2016-07-21 15:20:24
Original
921 people have browsed it

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.

2. Modify cmd.exe file properties

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

After this setting is completed, php can execute the exec command on the server.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325076.htmlTechArticlePreface: This article is for the windows php environment, and the linux system is not included in the discussion. For security reasons, the server does not allow PHP or other languages ​​to execute exec commands. When you have special needs...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template