简体   繁体   中英

PHP exec() not working on AppServ

I'm now facing the following problem. Please help me out.

I have two file in the same directory: and

<?php
  exec("Rscript test.r");
?>

d=c(1:10);
write.csv(d, file="test.csv", fileEncoding="utf-8");

q();

While I access the via chrome, it gives no . ,它没有给出

Although it works fine on cmd Rscript test.r , it does not work while executing . 不起作用。

Any suggestion?

Thanks

There are a few things to check:

  • File permissions. Set them to 0777 temporarily to see if it's working
  • Maybe the exec function is blocked. Check php.ini (or phpinfo() ) for disabled_functions
  • Third options - is one you really always need to consider - an error in your script.

Happy debugging !

PHP/IIS will need to read/execute permissions to the command you are trying to execute with your exec() function.

Go through PHP documentation for exec() function article.

Hope, It will resolve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM