exec() vs shell_exec()

Posted on 2009-02-24
Last Modified: 2012-05-06
What are the differnces between exec() vs shell_exec() in PHP?
Question by:hankknight
    LVL 14

    Expert Comment

    by:Ionut A. Tudor
    excerpt from php manual:
    exec  Execute an external program
    shell_exec  Execute command via shell and return the complete output as a string
    So maybe you can explain what exactly you need to achieve so we can advice the way you should proceed.
    LVL 16

    Author Comment

    All I need to do is resize an image using ImageMagick.

    convert -size 240x180 image.jpg -thumbnail 120x90 thumb.gif

    Open in new window

    LVL 14

    Accepted Solution

    Then use exec() to access that program.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now