2

hey I want to run php on command prompt with xampp server. I made 2 environmental variables C:\xampp\php and C:\xampp\mysql\bin. how to execute the php code now?

1

1 Answer 1

5

Run command from console

c:\xampp\<path to php>\php.exe <path_to_your_php_project>\your_script.php
Sign up to request clarification or add additional context in comments.

8 Comments

Even better - add the path to PHP to your system path
yes. i can execute it now. but i have one more php file in which i have html code and php tag also. but when i execute that php file then i am getting html code as output in cmd. How can i solve this error?
But why you trying to call script from console which generate HTML?
actually i have file upload code in html in which i am uploading photos and storing it in a folder on server.
Why you trying to do it from console?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.