Once a undocumented programmer is detained-a program that runs normally in linux, but cannot run when the php system is called! Solution

Source: Internet
Author: User
Once a undocumented programmer is detained-a program that runs normally in linux, but cannot run when the php system is called !!!!! My own cli program can run normally in linux (with parameters), but it cannot be executed after being called using php exec. In addition, the returned array is not empty for testing with isset, no data is output. It is certain that there is no problem between linux and php, because other programs are normal, called this one. Once a undocumented programmer is detained-a program that runs normally in linux, but cannot run when the php system is called !!!!!
My own cli program can run normally (with parameters) in linux, but it cannot be executed after it is called using php exec,
In addition, the returned array is tested with isset, and no data is output.
It is certain that there is no problem between linux and php, because other programs are normal, called this one.

What's going on? Which one should I start? Never met.

A little anxious. I am about to submit the source code !!!!!!!!!!!!

I have a soft-tested DS certificate, so I should not be detained. haha ......

------ Solution --------------------
Try using system
------ Solution --------------------
Is it about user permissions?
------ Solution --------------------
In other words, php exec operations are not common problems. I have tried to test a code before, but I have to quit.
------ Solution --------------------
Set the permission to-rwxr-xr-x

Open all the error messages and see what errors are reported!
------ Solution --------------------
Discussion
The code is not easy to post, and there will be no problems.
I can run the original mode copy command with parameters spliced by php on linux and get the correct output.

------ Solution --------------------
It is not only the user permission, but also the running environment, which may be different. Therefore, you need to paste the exec () line of code.

Although the real cause is not necessarily here, although it may not solve your problem, you cannot let everyone guess your practice to determine the cause?
------ Solution --------------------
It is almost certainly that your a. out has executed some banned operations in the case of-L 3.

BTW: when $ result = false, "isset ($ result) = 1 and print_r ($ result) is empty" may occur. this is no surprise.
------ Solution --------------------
Discussion
It is almost certainly that your a. out has executed some banned operations in the case of-L 3.

BTW: when $ result = false, "isset ($ result) = 1 and print_r ($ result) is empty" may occur. this is no surprise.

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.