简体   繁体   中英

Bash does not execute the certbot command

Bash does not execute the certbot command, how to find out why?

When I use ls command to test normal bash functions

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

Some way to extract bash error?

Do you specify the variable in -d $1 -d admin.$1 -d www.$1 port of the code, so $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 certificate.sh domain.com

where domain.com is your domain name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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