linux php执行shell,报错 命令找不到

1、PHP调用shell函数

string system ( string $command [, int &$return_var ] )

string exec ( string $command [, array &$output [, int &$return_var ]] )

void passthru ( string $command [, int &$return_var ] )

2、shell文件的话,注意问题

1)第一行:#!/bin/bash
2)注意换行格式
3)给shell有执行权限。sudo也行

3、报错找不到命令

找不到命令,需要用命令的绝对路径:
例:source /home/dell/anaconda3/bin/activate /home/dell/anaconda3/envs/py38

 

posted @   张志健  阅读(78)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示