Unable to create flutter web app using PHP

Hi Guys,

I am working on the flutter web project on windows machine. I have created one web project using PHP. All the work is done, only issue in below php command.

exec(“flutter build web”, $array, $return);

Does there anything where we can add the actual source code path manually?
Its working only when we run it in command line terminal.

Any help would be appreciated.

Thank you,

Since you have mentioned that this is working correctly in command line then in that case this doesn’t remain a flutter problem.

On top of that if flutter command works in command line then it means that flutter path is present is your environment variables.

For this to work in your php environment my guess is you either need to export flutter path before running this command or use the full path.

I can’t think of pros and cons of both the approaches as I have not done something like this in past but an obvious way would be to use the full path of installation of flutter. This can reduce the complexity while deploying the application.