小编cut*_*csc的帖子

在centos7中将php脚本作为systemd服务运行

我正在尝试在 centos7 启动时运行 phpscript。当前 systemd 进程如下所示

[Unit]
Description=custom Service
After=network.target

[Service]
Type=forking
User=root
ExecStart=/usr/bin/php /var/www/htdocs/mysite/public/index.php abc xyz >> /var/log/custom.log 2>&1 


[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

但是上面的脚本没有传递参数。我怎么能解决这个问题?谢谢!

php systemd centos7

4
推荐指数
1
解决办法
7179
查看次数

标签 统计

centos7 ×1

php ×1

systemd ×1