Jump to content

passthru(), system(), exec() not working .. potentially permissioning issues ?


lampstax

Recommended Posts

Hey guys,

 

I'm running WAMP on Windows 7 and trying to pass a command to mogrify.  I tried passthru(), system(), exec() but none worked. 

 

A sample command is

convert -format jpeg -extract 2048x1536+0+0 +repage -thumbnail 100x75 C:/wamp/www/alpha.offernation.org/uploads/properties/property_original_1277852331.jpg C:/wamp/www/alpha.offernation.org/uploads/properties/property_original_1277852331_100x75.jpg

 

I know the command itself works because if I run it directly from the DOS prompt it works.

 

When I run with a simple command like 'dir':

 

$last_line = passthru('dir', $retval);

 

I get the correct output  .. but when I replace 'dir' with the command above .. i get this:

 

 $last_line = 4  and $retval = NULL

 

I think it could be a permission issue with windows 7, but I'm not sure how to troubleshoot.  Google is not being very helpful either.

 

Can anyone point me in the right direction?

 

Thanks

Here's a few ideas for troubleshooting.  Generic ideas unfortunately, I don't know what your actual problem might be.

1.  Login as whatever user the web server runs as and run the command

2.  Deliberately give the command files it doesn't have access to and see what happens

3.  Execute "dir" on the paths you are giving to the convert command, see if it can access them

4.  Execute "move" on files in the paths you are giving to convert

5.  Execute your command with the "display help" option, and see if you do indeed get the help displayed as output.  If not then it may not be able to access that command at all.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.