[英]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.