V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
qkzy
V2EX  ›  PHP

求助! PHP 的 exec 和 system 怎么传递参数?

  •  
  •   qkzy · Mar 6, 2019 · 3439 views
    This topic created in 2613 days ago, the information mentioned may be changed or developed.

    执行 sh 脚本发现脚本怎么都获取不到参数,是有什么特殊转译要求么。。。?

    2 replies    2019-03-06 14:44:56 +08:00
    hetaoo
        1
    hetaoo  
       Mar 6, 2019
    如果是用 php 来写 shell 在终端运行的话,接受参数要使用 $argv 来接收的。
    KasuganoSoras
        2
    KasuganoSoras  
       Mar 6, 2019
    exec("/path/to/shell.sh arg1 arg2 arg3")
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2675 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 03:43 · PVG 11:43 · LAX 20:43 · JFK 23:43
    ♥ Do have faith in what you're doing.