After Effects Multiple instances hangs when rendering using PHP and Command Line
You may want to try to write the output of your task to a file and tell your system to start it as a background task by adding the &amp;:

exec('aerender.exe -project myproject.aepx -comp "Final" -mp  -output video.mov &gt;/dev/null &amp;')

It might also be something in your server setup, the max. memory maybe?