2

I need to use exec() function, but it doesn't work with params.

It works:

exec('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe');

It doesn't:

exec('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --headless --disable-gpu --screenshot=D:\file211.png --window-size=1920,1200 http://google.com')

What to do to set params in exec?

1 Answer 1

1

http://php.net/manual/en/function.exec.php:

Note: On Windows exec() will first start cmd.exe to launch the command. If you want to start an external program without starting cmd.exe use proc_open() with the bypass_shell option set.

You can also use popen() instead of proc_open():

$handle = popen('C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --headless --disable-gpu --screenshot=D:\file211.png --window-size=1920,1200 http://google.com', 'r');

...

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.