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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.