Skip to main content
wuerschmedia
Participant
January 22, 2015
Question

execute aerender from php

  • January 22, 2015
  • 2 replies
  • 1657 views

I am trying to execute the aerender shell command from a php file called batchrender.php

with the following content and execute it via web browser

<?php

passthru('/Applications/Adobe\ After\ Effects\ CC\ 2014/aerender -project /Users/abc/Sites/AETEST1.aep -comp "Komp1" -output /Users/abc/Sites/xcv101.mov 2>&1', $ouptput);

print_r($ouptput);

?>


When I call this php file via the shell (Terminal) it runs perfectly and starts to render.

When I call it via web browser the output in the browser shows:


"aerender version 13.2x49 PROGRESS: Launching After Effects... PROGRESS: ...After Effects successfully launched"


but does not start with rendering, but also gives no errors


We need this to start our AfterEffects Rendering remotely via php web-application, where we can change parameters for rendering and values for expressions used in the Composition.

AfterEffects runs on a Mac, who is also configured as a webserver with php/mysql



This topic has been closed for replies.

2 replies

Mylenium
Legend
January 22, 2015

Any PHP command runs in the security context of the server, which is simply different from accessing it locally. You need to include user privilege escalation in your script and harden it accordingly with additional authentication procedures to prevent unwanted intrusions.

Mylenium

wuerschmedia
Participant
January 23, 2015

The thing is, that aerender actually starts, it just does not start rendering, basically I assigned all needed rights.

It should output some errors, when it can't access any files or whatever.

Legend
February 2, 2015

You shouldn't run aerender directly from your PHP script as the security issues you come up against will drive you crazy.  You might be able to overcome them, but why would you want to do that to yourself?    

Anyways, I developed a system a while ago that is similar to what you are trying to achieve and I found that placing the aerender command is better suited inside a batch file--for security reasons at least.   Then, you should install PsExec on the same system as AE.  PHP can then tell PsExec to run the batch file containing the aerender command.  PsExec lets you "emulate" which user will run the batch file containing your aerender command--it's quite flexible in that allows you to run a command with elevated security tokens.  So, even though PsExec is intended for remote machines, you can still use it for the local machine.  Check out the listed switches / flags you can set on the link I provided.

Hope that helps somewhat!

--Arie

Community Expert
January 22, 2015

That's because there is no easily accessible connection from a browser to an app. You will need to write an extension for your web browser that you can use to control serenader....

Another option is remote desktop. It's important to note that both approaches expose security risks. Think about how dangerous it would be to have some code running in a server side app to take control of the most powerful and dangerous port on your system - the shell. If the door was open anyone could write a little PHP code that would format your boot drive as soon as you opened the web page.