簡體   English   中英

為什么我不能在我的PHP代碼中執行此終端命令?

[英]Why I can't execute this terminal comand in my php code?

我想通過ApacheBenchmark測試一個網站,並在執行后,people.txt只包含sh:1:ab:not found

我嘗試了ApacheBenchmark的完整路徑

<?php
$output = shell_exec('ab -k -c 350 -n 20000 www.yahoo.com 2>&1');
$file = 'people.txt'; 
file_put_contents($file, $output);
?>

您的系統上沒有安裝“ab”工具。 如果您使用的是基於Debian的操作系統(例如Ubuntu),請使用apt-get install apache2-utils進行安裝。 對於RedHat系統,請嘗試使用yum install httpd-tools

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM