문제

I tried googling for this issue and found many people with the same problem but no solution.

    $result = exec("C:\\Ruby191\\bin\\lessc.bat less\\$file", $output);

Here result is an empty string and output an empty array. Same thing with:

    $result = exec("cmd /c C:\\Ruby191\\bin\\lessc.bat less\\$file", $output);

I am sure the path is correct; I am sure exec() is enabled.

I tried exec, shell_exec, system and none work.

lessc is less CSS.


EDIT

The apache error log says:

'"ruby.exe"' is not recognized as an internal or external command, operable program or batch file.

도움이 되었습니까?

해결책

I found out the problem; I installed ruby just for this and added it to my PATH environment variable, and it started working immediately for command prompts.

However it didn't work for PHP, so I decided to restart my computer. After that it worked.

다른 팁

First chdir("C:\Ruby191\bin\"), then run lessc.bat.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top