exec无法在php脚本中工作(WAMP Server) [英] exec not working in php script ( WAMP Server )

查看:137
本文介绍了exec无法在php脚本中工作(WAMP Server)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在系统上使用WAMP服务器执行php脚本.

I am using WAMP server on my system to execute php scripts.

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

I want to execute a script test.php from my main script main.php.

为此,我正在使用像exec('php test.php');这样的exec函数.在test.php中,我给出了一个echo语句.

For that I am using exec function like this exec('php test.php');. In test.php I have given one echo statement.

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

But when I run my main.php script from the browser I am not able to see output of test.php script.

我在做什么错?请提出建议.

What am I doing wrong ? please suggest.

推荐答案

您必须提供php.exe

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

所以它必须是正确的路径

so it has to be a proper path

这篇关于exec无法在php脚本中工作(WAMP Server)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆