Not enough permission to run typeperf.exe

2019-07-21 14:21发布

Im Trying to run typeperf.exe with an php function exec();

this is the command ( for cpu load % ) typeperf -sc 1 "processor(_Total)\% Processor Time"

When im runing the command through a command prompt it is returning me the wanted result.

enter image description here

But when calling it trough exec(); Im getting

enter image description here

So I ran the command whoami through php to know what is the php user,

I got nt authority\iusr

So I setted the username to be in the Performance Log User Group as mentioned. And deseperatly added everyone in the group since this was not working.

enter image description here

What can I do to let php run a typeperf.exe comand ?

1条回答
时光不老,我们不散
2楼-- · 2019-07-21 14:45

You mention it does work when using command prompt. But even when using command prompt you need to start it as administrator (windows 8, possibly 7). If you dont you get the same error message.

So perhaps you could try to disable user account control to allow access without specific administrator privileges.. Check how-do-i-disable-administrator-prompt-in-windows-8 for some tips.

Also it mentions that the rights are only updated after logging in with the account. So it could very well be that your changes never do anything as you never log in using 'Everyone' or 'IUSR'.

查看更多
登录 后发表回答