douyou2234 2019-04-01 09:50
浏览 278

通过php脚本执行Chrome驱动程序/ apache权限问题

I am executing a program from my php script whose output i want to display on the webpage, There are multiple commands which are running based on inputs including some selenium tests,

i use popen("$cmd 2>&1 ; echo Exit status : $?", 'r'); in php .

everything works fine , but during selenium tests i get error as WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

I found that this was caused because the chrome driver was in home folder and the Apache user did not have permission to access it ,

i tried giving it 777 permission and even tried chaning the chown to the apache user , but nothing seems to have worked ,

The only solution i could get was to place my chromedriver in the html folder and access from there , which was working .

But it seems like a security issue by placing the driver directly inside the public HTML folder .

Is there a way i can get apache to access the chromedriver not in html folder. and what are the possible risks , if i do keep a driver inside the public html folder or give the apache user the permissions directly to apache user?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 matlab实现基于主成分变换的图像融合。
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊