Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to run ImageMagick from batch via exec() or passthru() I've already changed security settings for cmd.exe and ImageMagick folder. These are my current settings.

C:\ImageMagick-6.5.3-Q8 BUILTIN\Administrators:(OI)(CI)F 
                    COMPUTERNAME\IUSR_myusername:(OI)(CI)R 
                    NT AUTHORITY\SYSTEM:(OI)(CI)R 
                    BUILTIN\Users:(OI)(CI)R 

C:\WINDOWS\system32\cmd.exe COMPUTERNAME\TelnetClients:R 
                        COMPUTERNAME\psaadm:R 
                        COMPUTERNAME\psacln:R 
                        COMPUTERNAME\psaserv:R 
                        NT AUTHORITY\INTERACTIVE:R 
                        NT AUTHORITY\SERVICE:R 
                        NT AUTHORITY\SYSTEM:F 
                        BUILTIN\Administrators:F 
                        COMPUTERNAME\IUSR_myusername:R

After doing this this is the actual script that I'm trying to run:

error_reporting(E_ALL);

define("ABSOLUTE_PATH", "C:\\Inetpub\\vhosts\\myusername.com\\httpdocs\\online");
define("IMAGE_MAGICK_CONVERT", "C:\ImageMagick-6.5.3-Q8\convert.exe");
echo(IMAGE_MAGICK_CONVERT . " " . ABSOLUTE_PATH . "\\convert\\myfile1.jpg " . ABSOLUTE_PATH . "\\convert\\myfile1.pdf");
echo exec("cmd /c " . IMAGE_MAGICK_CONVERT . " " . ABSOLUTE_PATH . "\\convert\\myfile1.jpg " . ABSOLUTE_PATH . "\\convert\\myfile1.pdf 2>&1");
passthru(IMAGE_MAGICK_CONVERT . " " . ABSOLUTE_PATH . "\\convert\\myfile1.jpg " . ABSOLUTE_PATH . "\\convert\\myfile1.pdf 2>&1");

So I'm still receiving a Access is denied. Please help out...

share|improve this question

3 Answers 3

Run Process Monitor and watch to see what operation exactly is failing. It could well be writing to the ABSOLUTE_PATH\Convert directory.

share|improve this answer

You aren't doubling your backslashes in IMAGE_MAGICK_CONVERT.

share|improve this answer
up vote 0 down vote accepted

I've fixed it finally.. It was due security issues as expected ...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.