![](/img/trans.png)
[英]Shell script called from PHP does not work, but it works in command line
[英]Space in command line php argument called from linux script
我在Ubuntu中有此腳本,在這里我將文件稱為load.php,我想傳遞參數$ filexml
#!/bin/bash
...
filexml="/Program Files/myfile.xml"
./load.php $filexml
文件load.php是:
#!/usr/bin/env php
<?php
echo $_SERVER['argv']['params'][1];
exit;
但是結果是不完整的,因為它需要參數直到/ Program Files /目錄中的空格。 像這樣:
$/Program
請幫忙 :)
謝謝!
一如既往的解決方案。
./load.php "$filexml"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.