Php is not recognized as an internal or external command operable program or batch file

     

Have you ever faced this type of error while running PHPhường commvà from commvà prompt? Some PHPhường files like cron job and socket VPS, we need khổng lồ run them from commvà prompt. Normally this type of error only produce when we use php comm& in comm& prompt without web1_setting up PHP.. path in system environment variable. Thus, it will throw error lượt thích PHP. is not recognized as an internal or external command. So in this post, i will show you how to lớn thiết lập PHPhường path in system environment variable & get rid of this error.

Bạn đang xem: Php is not recognized as an internal or external command operable program or batch file

PHP is not recognized as an internal or external command error in windows comm& prompt.

*

Before continue, I assume that you have sầu already installed PHP.. in your windows system. If you haven’t then you can checkout our tutorial on how to install PHPhường in windows using XAMPPhường.

Now first of all find out PHPhường. path from your system. For XAMPPhường hệ thống, your installed PHPhường. path is (Drive sầu Name):/xampp/php . If you have sầu installed other PHP environment lượt thích WAMP.. or LAMPhường. then, please check PHP. path on google for them.

I have installed XAMPPhường in E: drive. So my PHPhường path is E:xamppphp.

Now open control panel và search for “System” and click on it.

*

Now clichồng on “Advanced System Settings“.

*


Now cliông xã on “Environment Variables“.

Xem thêm: Kiểm Tra Trùng Lặp Nội Dung Hiệu Quả Nhất, 10 Công Cụ Kiểm Tra Trùng Lặp Nội Dung Hiệu Quả

*

Now select Path in system variables section & cliông xã on Edit button.


Related: Laravel 5.8 Tovị CRUD Example Step By Step

*

Now add PHP. path (E:xamppphp) after (;) semicolon at last as shown below image and click Ok.

*

Now lets kiểm tra if error is fixed or not. If you have sầu already opened command prompt, please close and reopen it. Otherwise changes will not reflect on it. Set XAMPPhường. path (E:/xampp) in it.

Now run php -v commvà khổng lồ kiểm tra php version. If everything works fine than you will see version of PHPhường.

*

Congratulation you have sầu done it.

I hope that this tutorial helps you. If you have any query regarding this tutorial then please nội dung with me in the comments. I will help you khổng lồ short it out. Thank you for reading this article.