[英]How to restart apache2 from laravel?
I am working on a multi-tenant package Hyn/Multitenant for laravel and after creating a tenant I need to restart apache2. 我正在为laravel开发多租户程序包Hyn / Multitenant,创建租户后,我需要重新启动apache2。 Within the package, I have a command as:
在软件包中,我有一个命令:
apache2ctl graceful
But when this command executes, it throws an error that it can't bind to the port. 但是,当执行此命令时,它会引发一个错误,即无法绑定到端口。
So far I have a tried editing visudo with this command: 到目前为止,我已经尝试使用此命令编辑visudo:
www-data ALL=(ALL) NOPASSWD: /etc/init.d/apache2 restart
But it still throws error that it can't bind to port 80. 但是它仍然抛出无法绑定到端口80的错误。
php exec() method may help you - php exec()方法可能会帮助您-
exec("/etc/init.d/apache2 restart");
http://php.net/manual/en/function.exec.php http://php.net/manual/en/function.exec.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.