php shell command error GLIBCXX_3.4.9 not found

后端 未结 2 1176
故里飘歌
故里飘歌 2021-01-21 16:15

Im trying to execute shell command from php to convert files to pdf but i get this error.
Could someone explain me in details how to fix it?
Im not so good in linux(

2条回答
  •  忘掉有多难
    2021-01-21 17:02

    Try this method https://stackoverflow.com/a/63443384/12099812

    1.add below line in your PHP file.

    var_dump(shell_exec("whoami"));
    

    you can find the username in your browser after clicking the url related to your PHP file

    2.in your terminal

    sudo vim /ect/sudoers
    
    #in vim editor, add this line in your sudoers file
    "username ALL=(ALL) NOPASSWD:ALL"
    #change username to that found in step one 
    

    3.change the exec cmd in your PHP file to

    exec("sudo python3 urfilename.py")
    

    The main reason for your problem maybe the root permission, so by changing your sudoers file, the error might be tackled.

提交回复
热议问题