🎉 سال نو، مهارت نو، مشاوره رایگان نقشه راه برنامه نویسی (آفر ویژه ثبت نام قبل از افزایش قیمت 🔥)
۰ ثانیه
۰ دقیقه
۰ ساعت
۲ میلاد رئوف
دلیل 'php' is not recognized در code runner
جامعه پی اچ پی ایجاد شده در ۱۹ فروردین ۱۴۰۰

با سلام خدمت اساتید محترم 

برای ایجاد یک دیتابیس در داخل پی اچ پی در قسمت code runner به این مشکل برخوردم :

 

[Running] php "c:\xampp\htdocs\PHP-EXPERT-BASIC\پروژه‌های دوره ی 13\02-mysqli\index.php"
'php' is not recognized as an internal or external command,
operable program or batch file.
[Done] exited with code=1 in 0.068 seconds

 

لطفا راهنمایی کنید

 

 

 

کدها هم به این صورته :

 

<?php
$mysqli = new mysqli("localhost","root","","world");
if($mysqli -> connect_errno){
    echo "Filed to Connect to Mysql . Error: ". $mysqli-> connect_error;
    exit;
}
echo "Successfully Connected to Mysql";

مشکل vscod رو تونستم حل کنم ولی الان داخل windows power shell با این مشکل مواجه میشم :

 

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\Milad> mysql -h localhost -u root -p
mysql : The term 'mysql' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ mysql -h localhost -u root -p
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (mysql:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
میلاد رئوف ۱۹ فروردین ۱۴۰۰، ۱۵:۳۴

سلام  و احترام

این دستور رو توی cmd وارد کنید و یه بار دیگه امتحان کنید

set path=%PATH%;D:\xampp\mysql\bin;

 

امیر صالحی ۱۹ فروردین ۱۴۰۰، ۱۶:۱۵