Calling bash with PHP's shell_exec — slow

后端 未结 2 1226
难免孤独
难免孤独 2021-01-16 01:40

I\'m using PHP\'s shell_exec function to call a bash script on my server.

shell_exec(\"bash -x /tesladata/isetools/0-extractbytickerforweb.bash $ticker $ised         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-16 02:00

    You can take a look at PHP's exec and system functions, however I don't really see a reason why they would speed up the execution of the script, worth a try though. I'm pretty sure it is an issue with apache (assuming you're using apache), not PHP the source of this conclusion being this bug thread.

    Also you really should be extremely careful of using these commands on a public website. Make use of escapeshellarg and escapeshellcmd.

提交回复
热议问题