繁体   English   中英

exec无法在php脚本中工作(WAMP服务器)

[英]exec not working in php script ( WAMP Server )

我在我的系统上使用WAMP服务器来执行php脚本。

我想从我的主脚本main.php执行脚本test.php

为此,我使用exec函数,如这个exec('php test.php'); test.php我给出了一个echo语句。

但是当我从浏览器运行我的main.php脚本时,我无法看到test.php脚本的输出。

我究竟做错了什么 ? 请建议。

你必须给出正确的php.exe路径

exec("c:\wamp\<where ever you exe is>/php.exe test.php");

所以它必须是一条正确的道路

使用此命令

echo exec('php test.php', $output);  //this will print your echo statement.
print_r($output);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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