2
명령을 작동하지 않는 이유 :PHP의 shell_exec 최적화 플러그인 Optipng를 PNG로에 대한
튜토리얼을
Synopsis: optipng [options] files ...
Files: Image files of type: PNG, BMP, GIF, PNM or TIFF
Basic options:
-?, -h, -help show the extended help
-o optimization level (0-7) [default: 2]
-v run in verbose mode/show copyright and version info
Examples:
optipng file.png
(default speed)
optipng -o5 file.png
(slow)
optipng -o7 file.png
(very slow)
Type "optipng -h" for extended help.
그런 다음 나는 다음과 같은 PHP 코드를
$txt = shell_exec("C:\DSPadmin\DEV\optipng\optipng C:\Source\ChangSha\temp_process\production\zoomTxt\A06_text.png");
var_dump ($txt);
반환 NULL을 실행 명령을 사용하기위한 아무것도 실행하지 않았다
하지만 cmd 셸에서 동일한 명령을 실행할 때 나는 네이드
C:\DSPadmin\DEV\optipng\optipng C:\Source\ChangSha\temp_process\production\zoomTxt\A06_text.png
문제를 해결하는 방법은 예상대로 작동합니까? 감사합니다
은 안전 모드가 켜져 있습니까? 웹 서비스를 실행하는 사용자에게 명령을 실행하거나 출력 디렉토리에 쓸 수있는 권한이 있습니까? – Orangepill
이 함수가 기본적으로 비활성화되어 있지 않으면'php.ini'를 체크인 했습니까? 'php.ini'에서'disable_functions'을 찾으십시오 –
disable_functions = – user782104