alternates to system() and exec() in order to use ImageMagik?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news@celticbear.com

    alternates to system() and exec() in order to use ImageMagik?

    My Web host apepars to not allow exec() and system(), as a line in my
    script:

    system("convert -scale 100x100 $uploadfile $toimage");

    gives the error:

    "Warning: system() has been disabled for security reasons"

    Is there some other way to use ImageMagik (or is it GhostScript?)'s
    "convert" command in PHP that may be safer and generally allowed by Web
    hosts?

    Thanks for any suggestions.
    Liam

  • Andy Hassall

    #2
    Re: alternates to system() and exec() in order to use ImageMagik?

    On 21 Feb 2005 09:56:46 -0800, news@celticbear .com wrote:
    [color=blue]
    >My Web host apepars to not allow exec() and system(), as a line in my
    >script:
    >
    >system("conver t -scale 100x100 $uploadfile $toimage");
    >
    >gives the error:
    >
    >"Warning: system() has been disabled for security reasons"
    >
    >Is there some other way to use ImageMagik (or is it GhostScript?)'s
    >"convert" command in PHP that may be safer and generally allowed by Web
    >hosts?[/color]

    If system() and exec() are disabled, presumably proc_open() is too, so you're
    out of luck. There's an ImageMagick PHP extension in PECL, you could ask your
    host if they'd install that (but they probably won't!).



    (GhostScript is a Postscript processor - ImageMagick is the image processor)

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Andy Hassall

      #3
      Re: alternates to system() and exec() in order to use ImageMagik?

      On 21 Feb 2005 09:56:46 -0800, news@celticbear .com wrote:
      [color=blue]
      >My Web host apepars to not allow exec() and system(), as a line in my
      >script:
      >
      >system("conver t -scale 100x100 $uploadfile $toimage");
      >
      >gives the error:
      >
      >"Warning: system() has been disabled for security reasons"
      >
      >Is there some other way to use ImageMagik (or is it GhostScript?)'s
      >"convert" command in PHP that may be safer and generally allowed by Web
      >hosts?[/color]

      Should also mention that you may be able to use the GD functions, since
      they're bundled with PHP - http://uk2.php.net/image

      They're slower and not as good for photographic images as ImageMagick, but if
      you haven't got an alternative...

      --
      Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

      Comment

      • news@celticbear.com

        #4
        Re: alternates to system() and exec() in order to use ImageMagik?


        Andy Hassall wrote:[color=blue]
        > On 21 Feb 2005 09:56:46 -0800, news@celticbear .com wrote:
        >
        > Should also mention that you may be able to use the GD functions,[/color]
        since[color=blue]
        > they're bundled with PHP - http://uk2.php.net/image
        >
        > They're slower and not as good for photographic images as[/color]
        ImageMagick, but if[color=blue]
        > you haven't got an alternative...
        >[/color]

        Wow! Thanks; I had no idea PHP had such built-in image manipulation
        processes.
        Thanks!

        Comment

        Working...