[英]Bash does not execute the certbot command
Bash does not execute the certbot
command, how to find out why? Bash不执行certbot
命令,如何找出原因?
When I use ls
command to test normal bash functions 当我使用ls
命令测试正常的bash函数时
php: PHP:
$cmd = "/bin/bash /usr/local/openresty/nginx/html/pHpServer-PG/api/cert.bash test.com";
echo $cmd;
$ww = shell_exec($cmd);
var_dump($ww);
bash: 庆典:
#!/bin/bash
certbot certonly --rsa-key-size 4096 --webroot --agree-tos --no-eff-email --email email@gmail.com -w /usr/local/openresty/nginx/html -d $1 -d admin.$1 -d www.$1
I use php-fpm and nginx with user root 我用root用户使用php-fpm和nginx
Some way to extract bash error? 有哪些方法可以提取bash错误?
Do you specify the variable in -d $1 -d admin.$1 -d www.$1
port of the code, so $1
? 你在-d $1 -d admin.$1 -d www.$1
端口的代码中指定变量,所以$1
?
That suggests you're passing a domain name to the code. 这表明你将域名传递给代码。
You can also run the bash script with bash -x
, so eg if you named your script certificate.sh
, run 您还可以使用bash -x
运行bash脚本,例如,如果您将脚本命名为certificate.sh
,则运行
bash -x certificate.sh domain.com
where domain.com
is your domain name. domain.com
是您的域名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.