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