LOGO

Download PHP Source Code via Terminal Using Wget

August 1, 2014
Download PHP Source Code via Terminal Using Wget

Addressing Filename Redirection Issues with PHP Downloads

Obtaining files from PHP mirrors can present a challenge, as the redirector often renames downloaded files simply to "mirror." This can be inconvenient. Fortunately, the wget utility provides a straightforward solution to overcome this issue – and it’s applicable in numerous download scenarios.

When you need to specify a particular filename for the output generated by a wget command, the -O argument (a capital letter 'o') is employed. Alternatively, the more verbose form, --output-document=FILE, can be used, though it requires more typing.

Utilizing the -O Argument

To ensure PHP source code is downloaded with a designated filename, the following command structure can be implemented:

wget -O php-5.5.14.tar.gz http://us.php.net/get/php-5.5.14.tar.gz/from/this/mirror

This command directs wget to save the downloaded file from the specified mirror link as "php-5.5.14.tar.gz." Naturally, the version number should be adjusted to reflect the desired PHP version.

It’s important to note that the version number used in the example may not represent the most current release available at the time of execution.

The -O option is a powerful tool for controlling the naming of downloaded files, ensuring clarity and organization in your file management system.

Wget’s ability to rename downloaded files is not limited to PHP source code; it can be applied to any file downloaded using the utility.

This functionality streamlines the download process and eliminates the need for manual renaming after the download is complete.

#PHP#source code#download#wget#terminal#command line