You are here: Re: System() has been disabled « All PHP « IT news, forums, messages
Re: System() has been disabled

Posted by Janwillem Borleffs on 05/22/05 02:35

plato wrote:
> I am trying to call the mogrify command (Imagemagick) from a Photopost
> script. This script has worked successfully for years with no
> problems.
>
> Now I get an error System() has been disabled for security reasons in
> ......
>
> Info tells me the command is working on the server.
>
> How can I get around the error.

Assuming that you do not have direct control to the php.ini file and since
the responsible directive (disable_functions) isn't configurable through
ini_set() or an .htaccess file, an option would be to use Perl (most hosting
accounts include Perl support without restrictions) and pass its response to
your PHP script.

The Perl script can be very simple, e.g.:

#!/usr/bin/perl
use CGI qw/:standard/;

# Print header
print "Content-Type: text/plain\n\n";

# Excecute command
exec "cmd " . param('arg');

(Don't forget to perform a chmod 775 on the Perl script to make it
executable)

Invocation with PHP is also very simple, example:

$result = file_get_contents("http://host/cgi-bin/exec.pl?arg=$arg");


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация