473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

Jul 17 '05 #1
3 2597
On 21 Feb 2005 09:56:46 -0800, ne**@celticbear.com wrote:
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?


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!).

http://pecl.php.net/package/imagick

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

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
On 21 Feb 2005 09:56:46 -0800, ne**@celticbear.com wrote:
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?


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 / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3

Andy Hassall wrote:
On 21 Feb 2005 09:56:46 -0800, ne**@celticbear.com wrote:

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...


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

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
by: Jerry | last post by:
I've found a problem with exec, passthru, shell_exec & system. I'm trying to run the following exec("sort -r -n -k2,2 r1.txt > r2.txt") with r1.txt being a numeric file. The file looks like...
2
by: eichin | last post by:
One of my recent projects has involved taking an accretion of sh and perl scripts and "doing them right" - making them modular, improving the error reporting, making it easier to add even more...
1
by: Andr? Roberge | last post by:
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py--
0
by: Nick Coghlan | last post by:
<Sorry for the disconnected reply - I've been having news server issues, and just switched to the mailing list instead> Andr? Roberge wrote: > I don't understand why I need to use the global...
2
by: DaBrain | last post by:
I am no DBA, but this is my task. I have an SQL Server 2000 Database that has an "SQL Account" that has execute permission on all Stored procedures. it is what was used by the company. This...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
0
by: =?ISO-8859-1?Q?Crist=F3v=E3o_Sousa?= | last post by:
Hi, I'm having some trouble with a C project in a Linux system. I already know which is the problem but I don't know how to fix it. I have a program that links to a third party static library....
8
by: r0g | last post by:
Hi There, I'm trying to migrate a locally hosted page from windows to a private Ubuntu development server and one of the key bits of functionality (which used to work fine in Windows) was the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.