How to run python scrapy from php

I have python scrapy for crawling data from the web site.
BTW, I should run the spiders from the php.
I tried to run the spiders with php, but I can’t run that.
I use virtual environment.

This is my php script:

$command = escapeshellcmd("scrapy crawl spider_name ");
$output = shell_exec($command);

How can I solve this problem?

Could you post any error codes and language versions? This will help localize the issue.

Why do you need to run the spiders from php? Is it possible to just schedule the spiders so that they run periodically?