doujiao1538 2014-06-19 07:08
浏览 146
已采纳

使用exec()从PHP运行PhantomJS

I've got the following script:

#!/bin/sh
export DISPLAY=:0
phantomjs --version

It try to run it from the following PHP script:

<?php
$result = shell_exec('sh test.sh'); 
echo $result;
?>

This script return the following error:

[Thu Jun 19 10:31:31 2014] [error] [client] test.sh: line 3: phantomjs: command not found

I tried to run phantomjs -v by hand in a console, and it runs fine. I checked the PATH, and phantomjs is correctly defined and found.

The execution environment is a virtual Server with LiveConfig. Can someone help me understand what I'm doing wrong ?

  • 写回答

4条回答 默认 最新

    报告相同问题?

    相关推荐 更多相似问题

    悬赏问题

    • ¥15 unittest __import__加载名为‘1’的model无法找到
    • ¥30 魔术师读心术猜数字实验
    • ¥15 关于#Python#的问题,如何解决?
    • ¥15 CMD 生成TXT内容输出成一行
    • ¥20 关于#pandas#的问题,如何解决?(语言-python)
    • ¥30 c语言设计井字棋小游戏
    • ¥15 关于属性关联的双极容度多属性决策vikor方法的公式
    • ¥15 10吨190马力爆炸品运输车,以80km/h的速度行驶1个小时输出的动能或者做的功是多少?
    • ¥15 《phthon编程从入门到实践》第十八章,从django入手,learning_log,ModuleNotFoundError: No module named 'learning_logs
    • ¥15 echarts 放入折叠面板宽高的问题