dpleylxzx47207117 2014-10-09 15:15
浏览 52

Exec()w / -rwxr-xr-x上的权限被拒绝

**I have tried permissions but still getting this error

Array ( [0] => sh: 1: /var/www/nodejs/tmp: Permission denied )

The command is execute from the route file of Laravel(MVC PHP Web application)

Tried CHMOD 777 , CHMOD +x etc.

My current permission is as follows

-rwxr-xr-x 1 root root *number* Oct 9 21:35 test.js

What did i not do?

My php code

$user_input = "http://google.com/";

    putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
    exec('/var/www/nodejs/tmp test.js $user_input 2>&1',$output);

    print_r($output);   
  • 写回答

2条回答 默认 最新

  • dops57958 2014-10-09 15:57
    关注

    Your test.js may be a script

    In that case make sure the interpreter is also executable

    another possibility is that your file is on a filesystem with no execute permissions

    评论

报告相同问题?