Use exec to execute the cmd command and return a blank solution

Source: Internet
Author: User
This file is stored in the website Root Directory & nbsp; execute the command $ cmd & nbsp; c: phpwww00002swf & nbsp; c: phpwwwupload1.pdf & nbsp; using the exec function in php; c: phpwwwupload1.swfexec ($ cmd run the cmd command with exec to return null
I put the file 2swf.exe in swftoolsto the website root directory and execute commands using the exec function in php.
$ Cmd = "c:/php/www/ipv2swf c:/php/www/upload/1.pdf c:/php/www/upload/1.swf"
Exec ($ cmd );
I directly paste this code into the command line and execute it correctly. the last two parameters that can be called by php but fail to be successfully exec are added. The second parameter is array (); the third parameter is 1, I directly put a php file under the same directory after modification. the exec (00002swf 1.pdf 1.swf) file can be successfully executed. why?
Note: The above code is completely passed in my local test. if it is put on the server, the above error occurs. all of them are apache locally used by IIS on windows2003.
------ Solution ----------------------
Try again with single quotes ...... I don't want this problem either. try it.
------ Solution ----------------------
The first thing to solve is the permission issue.
If the command can be correctly executed in the command line or batch processing, the problem lies in "permission"
Of course, you will not disable the exec function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.