exec(), passthru()-there is a problem when calling system commands

WBOY
Release: 2016-08-29 08:50:48
Original
932 people have browsed it

The php file calls system commands. If you execute the php file directly in the terminal, it can be executed. However, there is no response when accessing the file in the web server. What is the problem? Permissions issue? then what. . .

Reply content:

The php file calls system commands. If you execute the php file directly in the terminal, it can be executed. However, there is no response when accessing the file in the web server. What is the problem? Permissions issue? then what. . .

It should be a permissions issue

I encountered a similar problem just now. You said you can't execute the ffmpeg command, right? I can't execute the command to generate pictures.
We are all successful in executing it directly from the command line, but calling it in php is not possible, right? And ordinary commands can succeed.
I think what our problems have in common is that we all need to generate files.
My situation is that I created a new directory in the apache default web directory and placed the php file in it, but I did not grant write permission to this directory. I only gave permission to the php file inside, and then I couldn't find it. to the reason.
I just tried to give write permission to the entire directory and it worked.
I don’t know if you have a similar situation. If not, it may be a configuration problem with php.ini, such as safe_mode=off not being configured.
Hope it helps you~

Related labels:
php
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!