简体   繁体   English

PHP exec,系统,shell_exec在ubuntu机器上无法使用wget

[英]PHP exec,system,shell_exec not working with wget on ubuntu machine

i have a simple script which im testing at the moment but it's not working. 我有一个简单的脚本,我现在正在测试,但它不起作用。

I have this simple lines : 我有这么简单的台词:

$url = "http://www.google.com";   
system("wget --page-requisites ".$url); 

The issue is that it does nothing, my website is located at /var/www/html/server_a which is where im checking if it downloaded the required page but seems like it's doing nothing. 问题是它什么也没做,我的网站位于/ var / www / html / server_a,这是我检查它是否下载了所需的页面,但似乎它什么也没做。

Im using a VPS with Ubuntu 14.04 我使用VPS与Ubuntu 14.04

Your issue is sudo, you need to add sudo before you run this command. 你的问题是sudo,你需要在运行此命令之前添加sudo。

$url = "http://www.google.com";   
system("sudo wget --page-requisites ".$url); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM