-1

I am using PHP codeigniter on ubuntu where I want to open specific link in chrome browser. like on button click "https://stackoverflow.com/" will open in chrome browser. I can open it from terminal using below command

chromium-browser https://stackoverflow.com

but it do not run from PHP

exec("chromium-browser https://stackoverflow.com");

I can use file_get_contents but I can not restrict chrome browser only.

hrishi
  • 1,610
  • 6
  • 26
  • 43
  • 1
    There is [another question here](https://stackoverflow.com/questions/45923331/solved-chromium-not-opening-full-url-when-started-with-os-system-py) linking **[this github library](https://github.com/gsouf/headless-chromium-php)**, have u tried? – Erhan Yaşar Feb 22 '18 at 06:39
  • I will check that. Thank you. – hrishi Feb 22 '18 at 07:22
  • You have 374 reputation, a 'top %56 this quarter badge', not typed on google "how to open a url on chromium browser with php" and still don't know how to thank you. You should visit **[Tour page on Stackoverflow](https://stackoverflow.com/tour)** – Erhan Yaşar Feb 22 '18 at 07:32
  • @Erhan Yaşar : I searched using chrome instead of chromium and found nothing useful – hrishi Feb 22 '18 at 09:17
  • @Renati : My question is for specific browser even PHP script is running on firefox I want to open chrome using script. – hrishi Feb 22 '18 at 09:18

1 Answers1

-1

I think that this is impossible. Tou try execute command from server (PHP) for open a program to the client (browser). You must try it in javascript.