我想通过网页重启Linux系统,用的是php语句实现,麻烦各位了。

解决方案 »

  1.   

    把apache用戶設為root.
      

  2.   

    vim /etc/apache2/envvars找到APACHE_RUN_USER 和 APACHE_RUN_GROUP 修改。
      

  3.   

    我有一个变通的办法, 做一个shell, 每分钟读取一个文件, 这个文件用php写入。 
      

  4.   

    有个思路不知道行不行:
    1、写个shell脚本 里面写shutdown -r now
    2、php里面有system和exec函数
    你用php运行一下这个脚本看行不行,不行说明运行php的用户没有这个权限,该权限的话apache配置文件里面是这样:
    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.  
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User daemon
    Group daemon
      

  5.   

    你把apache的user设置为sudoer……然后sudo init 6试试