Active7 years, 5 months ago

I can't get wget to work when called from PHP through exec().

Wget supports proxy servers, which can lighten the network load, speed up retrieval and provide access behind firewalls. If you are behind a firewall that requires the use of a socks style gateway, you can get the socks library and compile wget with support for socks.

The code is:

exec('wget -b --timeout=300 --no-check-certificate -O c:wgetlog.txt http://localhost/project/someparam/somevalue > c:wgetout.txt')

The called URL is an action from a project based on Zend Framework that manipulates some data in a MySQL database.

When the above is executed, only 'c:wgetout.txt' is created, and is empty.

The setup is as follows:

  1. Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange.
  2. 'The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing.
  3. Vous pouvez utiliser une URL comme nom de fichier avec cette. Use an NTLM Authentication Proxy Server. URL from the same machine with cURL our wget, it works.
  • Windows 7
  • XAMPP
  • PHP ver 5.3.5
  • wget latest version from here
  • PHP safe_mode is Off

wget is installed in 'C:Program Files (x86)GnuWin32bin', and this is added to the Windows PATH variable.

I know the wget setup is working because when running the above exec parameter (as echoed)

wget -b --timeout=300 --no-check-certificate -O c:wgetlog.txt http://localhost/project/someparam/somevalue > c:wgetout.txt

in a command prompt, it runs fine, I get the expected results in the database, and both files 'C:wgetlog.txt' and 'C:wgetout.txt' are created, with the latter containing wget's output (process id, etc).

LATER EDIT:

Got it working thanks to Crontab's suggestion and used the absolute path for calling wget, also enclosed it in double quotes.

Used WSH COM object to run it instead of plain exec().

Also, on Windows, the -b parameter doesn't work if the output isn't directed somewhere. As I'm not particularly interested in the output, I directed it to > NUL 2>&1 (this includes errors also).

Free download printer driver hp laserjet m1136 mfp. Hp laserjet m1136 mfp free download - Showhow2 for HP LaserJet M1136, HP LaserJet M1522 MFP Series PCL 6, HP LaserJet M4345 MFP PS, and many more programs. Printer driver. Find support and troubleshooting info including software, drivers, and manuals for your HP LaserJet Pro M1136 Multifunction Printer series. Download the latest driver, firmware, and software for your HP LaserJet Pro M1136 Multifunction Printer.This is HP's official website to download drivers free of cost for your HP Computing and Printing products for Windows and Mac operating system. HP LaserJet Pro M1136 Multifunction Printer is a multifunction printer that allows you to print, scan, and copy using a single machine and save energy, reducing the impact on the environment. Provided the hi-speed USB 2.0 port for connecting the printer to your computer or laptop.

I quickly made this function to help me test my project on a Windows machine and have wget working, so here it is, in case anyone finds it useful:

Please mind that it's customized for my own setup (absolute path to wget), it's for testing purposes only (only use the Windows machine for testing, the actual production machine runs Linux), the OS checking method might not be the best, etc.

binar
binar

Telecharger Fichier Php Avec Wget Proxy Environment

binar
1,0121 gold badge11 silver badges24 bronze badges

1 Answer

Try using an absolute path to wget - it's probably not in your script's path. To avoid using the absolute path, you could try adding putenv('PATH=<whatever-paths-you-need-colon-delimited>'); in your script before you access wget. Another way would be to directly modify the PATH environment variable of whatever user is running your webserver (and hence whichever user runs the PHP interpreter).

CrontabCrontab
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged phpwindowsexecwget or ask your own question.

Recently on 12 July 2016, Joomla 3.6 released, which is a major release in the Joomla 3.x series and comes with more than 400 improvements, including new features, support for PHP 7, which drastically increases speed of websites.

Important: The Joomla team strongly recommend that you should update your current websites immediately to latest release version.

This post guides you step by step installation of Joomla CMS (Content Management System) tool on Linux Operating System. There are number of installation ways available on internet. However, we have kept in mind for those beginners who are new to Joomla and Linux platform. Installation steps works on RHEL/CentOS/Fedora Linux Operating System. We have chosen LAMP (Linux, Apache, MySQL, PHP) installation method for this article.

What is Joomla?

Joomla is a popular Open Source Content Management System (CMS) tool which allows us to easily build dynamic website and manage online applications. It also manage & publish your website contents like video, pictures, articles on the website. Joomla is freely available, which supports huge third party plug-ins and themes. With the help of Content Management System (CMS), you can set up websites in the World Wide Web (WWW) without having knowledge of programming.

Optimized Joomla Hosting with Free Domain + 50% OffAdvertisement

Joomla Requirements

Comment Ouvrir Un Fichier.php Avec Xampp

  1. Apache
  2. PHP
  3. MySQL/MariaDB

What is LAMP (Linux, Apache, MySQL/MariaDB, PHP)?

LAMP is an open source web development software stack wherein Linux as the Operating System, Apache is the Web Server, MySQL is a RDBMS, MariaDB is a community-developed fork of the MySQL and PHP as the object-oriented scripting language.

Please follow below link to install LAMP environment on your Linux systems.

In this post, I used hostname as “joomla.tecmint.com” with the IP address 192.168.0.104. These settings may differ at your environment, so please change them where appropriate. Also all the steps have been executed with root privileges. So make sure you have root login credential.

Step 1: Downloading Joomla 3.6

This installation method guides you how to install latest Joomla 3.6 using LAMP setup on RHEL, CentOS and Fedora. Use “wget” command to download latest source tarball.

Download Joomla

Copy downloaded source files package and extract it under Apache DocumentRoot directory (i.e /var/www/html/).

Telecharger Fichier Php Avec Wget Proxy Authentication

Warning: If you extracted the files into a folder called ‘Joomla‘, then your site will be accessed at yoursitename.com/Joomla.

Step 2: Change the Ownership of Directory

Remove source file and change ownership of directory with user and group “apache” recursively with below command.

Step 3: Apache Server Configuration

If you’re planning to host only your Joomla website under your Apache web server, then you should follow these steps or else go for Apache virtual hosting and create a separate vhost for your Joomla site and follow rest of the instructions in this article.

Open Apache configuration file with VI or your choice editor.

Search directive as below and change it appropriate.

Note: User and Group should be apache

Step 4: Restart httpd (Apache) Service

Restart Apache web service.

To make httpd service started automatically in next boot, use below command.

Verify your httpd is running and listening request on port 80.

Step 5: Iptables (Firewall) Configuration:

Please open port 80 on firewall or disable iptables.

Step 6: Create Joomla Database

Telecharger Fichier Php Avec Wget Proxy Setting

If you’ve net set MySQL root password, you can set using following command or else skip if you already set.

Login with root credential in MySQL.

Create database called “joomla” in MySQL.

Grant privilege on joomla database for “joomla” user in MySQL.

Restart MySQL service and auto enable at system startup.

Step 7: Installation and Configuration of Joomla

Open your browser and type http://192.168.0.11 which will open below screen to configure Joomla step by step.

Telecharger Fichier Php Avec Wget Proxy Example

Step 8: Database Configuration

Fill up the details like database name, username and password which was set earlier in Step 6 for MySQL settings and click ‘Next‘.

Step 9: FTP Configuration

Leave blank as we are not using FTP and click ‘Next‘.

Step 10: Install Sample Data

Install Sample Data and click ‘Install‘.

Step 12: Congratulation! Joomla ! Installation Completed.

Notice: If you get any error saying that the configuration file or directory is not writable, that means you have to copy and paste the following configuration code to ‘configuration.php’ file in your site root folder.

Caution: Remove installation directory clicking button ‘Remove Installation‘. If you get error that installation folder could not be deleted, you can use following command to delete manually.

Step 13: Login in Joomla

Joomla Login

Step 15: Site administrator Login

Step 16: Control Panel of website test.tecmint.com

Step 17: Updating Joomla (Update Method)

The easiest method of updating Joomla to newest version is using One click update. This method is only suitable for Joomla 3.x.x to 3.x.x – updates (maintenance update).

If there is an update, Joomla will alert you at your Administrator control panel. Joomla will not auto update, it’s site administrator responsibility to start and verify the update.

For example, in this Joomla update section, we will see how to update from Joomla 3.4.3 to 3.6 version.

Important: Don’t forget to take your CURRENT BACKUP of your site, before doing an update.

Login into administrative control panel and see for the update notification at the top that says Update Now.

Update Joomla

Once you click on Update Now button, it will show you the installed Joomla version and latest available version. Here you will have two options, one ‘Write files directly‘ is the default method and second is ‘Write files using FTP‘ to update new core files to your Joomla installation.

If you already have FTP setup in place, you can choose FTP update option, or simply click on Install the Update button to carry updates.

Note Hp 7475a plotter service manual. : Once update process overs, you may need to clear your browser cache to adjust for any changes in the JS/CSS files.

If you have any query in this regard, please write on comment box below.

We’ll work for you…!!!

We also provide hosting solution in WordPress & Joomla as well as migration from Joomla to WordPress or vice versa with minimum charges. If you want us to do it for you please contact us.

Share