473,806 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2617
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("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?


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.andyhsoftwa re.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("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?


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.andyhsoftwa re.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
4967
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 webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
3
3388
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 this: 237 291 845 152 585 3 193 810 173 484 151 3
2
3375
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 features to them. "Of course," I'm redoing them in python - much of the cut&paste reuse has become common functions, which then get made more robust and have a common style and are callable from other (python) tools directly, instead of having to...
1
2235
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
1509
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 statement within the > definition of c() in order for it to know what a() is. If I define > exec_code() within test.py and use it there, I do not get any error, > with or without the use of a global statement. I get the same behaviour (Windows...
2
4026
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 one account is used by "all workstations". I want to fix this and use Windows Accounts, and get rid of that SQL Account. How do I go about adding that Windows Account permission to all the Stored Procedures?
2
3983
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: D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>asant database Buildfile: build.xml env-user: prop-user: set-user:
0
1087
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. The problem is that the library declares a internal global variable named 'accept' not visible by the user. In my program I use the system Internet Sockets which API have a function named 'accept'. When I compile it does not complies but when I...
8
6616
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 ability for the page to start a file browser via PHP's exec() function. I can't get this working under Ubuntu though e.g. <?php exec('nautilus /var/www'); ?>
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.