質問編集履歴

7

修正

2017/02/17 13:29

投稿

allll
allll

スコア42

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
- CentOSで、PHPの外部実行とターミナルでコマンドを実行したときの
1
+ CentOSで、WebアクセスしたPHPの外部実行と
2
2
 
3
- 挙動が違い困っております。
3
+ ターミナルでコマンドを実行したときの挙動が違い困っております。
4
4
 
5
5
  コマンドはターミナルで正しく動作することを確認しているものです。
6
6
 

6

コード修正

2017/02/17 13:29

投稿

allll
allll

スコア42

test CHANGED
File without changes
test CHANGED
@@ -40,11 +40,7 @@
40
40
 
41
41
 
42
42
 
43
- $command = "libreoffice --headless --convert-to pdf:calc_pdf_Export ";
43
+ $command = "libreoffice --headless --convert-to pdf:calc_pdf_Export --outdir $outdir $outdir/test.xlsx";
44
-
45
- $command .= "--outdir $outdir ";
46
-
47
- $command .= "$outdir/test.xlsx";
48
44
 
49
45
 
50
46
 

5

コード修正

2017/02/17 07:04

投稿

allll
allll

スコア42

test CHANGED
File without changes
test CHANGED
@@ -40,11 +40,7 @@
40
40
 
41
41
 
42
42
 
43
- $command = "libreoffice ";
44
-
45
- $command .= "--headless ";
46
-
47
- $command .= "--convert-to pdf:calc_pdf_Export ";
43
+ $command = "libreoffice --headless --convert-to pdf:calc_pdf_Export ";
48
44
 
49
45
  $command .= "--outdir $outdir ";
50
46
 

4

コマンド追加

2017/02/17 07:03

投稿

allll
allll

スコア42

test CHANGED
File without changes
test CHANGED
@@ -36,7 +36,21 @@
36
36
 
37
37
  ```PHP
38
38
 
39
- // 実行コマンド
39
+ $outdir = __DIR__ . '/output';
40
+
41
+
42
+
43
+ $command = "libreoffice ";
44
+
45
+ $command .= "--headless ";
46
+
47
+ $command .= "--convert-to pdf:calc_pdf_Export ";
48
+
49
+ $command .= "--outdir $outdir ";
50
+
51
+ $command .= "$outdir/test.xlsx";
52
+
53
+
40
54
 
41
55
  echo shell_exec('export HOME=/tmp &&' . $command);
42
56
 

3

文法修正

2017/02/17 07:02

投稿

allll
allll

スコア42

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  LibreOfficeでExcelからPDF変換をコマンドで行っていますが
12
12
 
13
- 生成したPDFのフォントに差分があり調査しています。
13
+ 表題の通り、生成したPDFのフォントに差分があり調査しています。
14
14
 
15
15
 
16
16
 

2

題名編集

2017/02/17 06:49

投稿

allll
allll

スコア42

test CHANGED
@@ -1 +1 @@
1
- PHPの外部実行と、ターミナルでの実行結果違いについて
1
+ PHPの外部実行と、ターミナルでの実行結果違いについて
test CHANGED
File without changes

1

件名編集

2017/02/17 06:48

投稿

allll
allll

スコア42

test CHANGED
@@ -1 +1 @@
1
- PHPの外部実行と、ターミナルで実行時の環境差分について
1
+ PHPの外部実行と、ターミナルで実行結果違いについて
test CHANGED
File without changes