简体   繁体   English

php exec 返回 sh: 1: 'not found'

[英]php exec returning sh: 1: 'not found'

So I've installed 'translate-toolkit' to use 'po2txt', everything works fine when I run it in terminal.所以我安装了'translate-toolkit'来使用'po2txt',当我在终端中运行它时一切正常。 But when I try run it in a php file,但是当我尝试在 php 文件中运行它时,

<?php

exec('po2txt --version');

I get sh: 1: po2txt: not found我得到sh: 1: po2txt: not found

I'm really unsure about what I've missed, if I run for example我真的不确定我错过了什么,例如我跑步

<?php

exec('git --version');

It returns normally.它正常返回。 So I guess I'm unsure as to why it works when I use it in terminal but if I try execute it through a php file it isn't found..所以我想我不确定当我在终端中使用它时它为什么会起作用,但是如果我尝试通过 php 文件执行它,它就找不到了..

Where is the installation path of po2txt ? po2txt的安装路径在po2txt
You can simply find it by running this command in terminal: which po2txt您可以通过在终端中运行此命令来简单地找到它: which po2txt
check the path of po2txt is exists in your PATH variable?检查您的PATH变量中是否存在po2txtPATH

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

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