Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:40:48+00:00 2026-05-28T00:40:48+00:00

I have found a PHP project that wraps all the main command line image

  • 0

I have found a PHP project that wraps all the main command line image optimizer’s, this is something I have been looking for, for a while now.

The problem I am having so far is I am wanting to run this on a Windows system. Below are some of the commands that are run from the scripts.

So my question would be, how would I go about running these external programs on my windows system, they do have windows versions, it’s just a matter of getting this PHP to call the correct commands.

So things like /usr/bin/identify how would this translate to being ran on a Windows system?

exec("/usr/bin/identify -quiet -format \"%m\" $file_path", $return, $error);

$cmd = "/usr/bin/jpegtran -copy none -progressive -optimize $src_file > $dest_file";

$cmd = "/usr/bin/convert $src_file $raw_file";

exec("/usr/bin/pngcrush -rem alla -brute -reduce $raw_file $dest_file");

$cmd = "/usr/bin/gifsicle -O2 $src_file > $dest_file";

$cmd = "/usr/bin/pngquant -ordered 256 $src_file";

 $cmd = "/usr/bin/pngout -c3 -d8 -y -force $quant_file $out_file";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:40:49+00:00Added an answer on May 28, 2026 at 12:40 am

    These aren’t really Unix-specific apps. They’re a variety of graphics-editing programs. Most or all of them are probably available on Windows; you just need to install them (the way somebody else already installed them on the Unix box that your script was originally written for).

    The only Unix-specific thing here is the path where it looks for the programs (/usr/bin for everything in your example). On Windows, apps typically install to a subdirectory under either C:\Program Files or C:\Program Files (x86).

    identify and convert are part of ImageMagick. You would need to download and install it, and then change the exec call to point to the path where the EXEs were installed (e.g. under C:\Program Files). Since the install path will probably contain spaces, you’ll need to quote it, e.g.:

    exec("\"C:\\Program Files (x86)\\ImageMagick-6.6.1-Q16\\identify\" -quiet -format \"%m\" $file_path", $return, $error);
    

    The other apps you’re running — jpegtran, pngcrush, gifsicle, pngquant, and pngout — are separate apps. You can Google them to find their individual download pages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found some libraries or web services in PHP that does the job.
I found this PHP code in an app I have to modify... $links =
I have been working with the Ebay api for a project and have found
The title pretty much says it all. I have a project that for political
I have a project that needs to access a DLL with PHP. The server
In a recent project I have found that they're using smarty and the client
I have a project in PHP that uses multiple tabs on a single page,
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I am a big fan of jquery and PHP. I have already found a
I have a content type called fund. The contents of this is in node-fund.tpl.php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.