Enable shell_exec() in wamp server

后端 未结 10 1757
臣服心动
臣服心动 2021-01-05 17:22

Recently I have passed one issue on wamp server..I need to use the shell_exec() function in PHP for running some external shell script (some checksum file) . Bu

相关标签:
10条回答
  • 2021-01-05 17:54

    Try using a WAMP server stack, which is clearly for development, like WPN-XM or XAMPP. Without any security limitations for the developer. So you won't run into trouble, when executing system(), shell_exec(), passthrough().

    0 讨论(0)
  • 2021-01-05 17:55

    I was having the same problem and tried a lot of solutions out there. What worked out for me was running XAMPP as Admin.

    0 讨论(0)
  • 2021-01-05 17:57

    I think we can use these steps

    1. Open wamp\bin\apache\apache2.4.9\bin(doesn't matter apache version)
    2. Open php.ini file in editor
    3. Search for "disable_functions".
    4. Remove exec and shell_exec from disable function
    5. Restart all services.

    Enjoy!!!

    0 讨论(0)
  • 2021-01-05 17:58

    The following line was the best I read to this problem: "You need to disable safe mode in the php.ini located in the \Apache2\bin folder, not the php folder. Restart Apache2 service right after to load the new settings."

    The solution is:

    1. stop all services from Wamp-Server and close the programm

    2. Open .../wamp/bin/apache/Apache2../bin/php.ini

    3. copy php.ini to desktop and open it

    4. set safe_mode_exec_dir (line after = is empty, so IT IS ON!!!) set it off!

    5. save

    6. copy back to dir (maybe you need admin rights)

    7. start wamp-server

    8. enjoy exec() and co.

    0 讨论(0)
  • 2021-01-05 18:00

    I just found a better explanation, but didn't tried it yet. Have a look - http://discussion.accuwebhost.com/linux-server/1096-how-enable-shell_exec-function-one-account.html

    0 讨论(0)
  • 2021-01-05 18:12

    Open your php.ini file used by wamp, find the disable_functions part, change it and restart the server.

    0 讨论(0)
提交回复
热议问题