Dark Mode Logo (Optional)

Dark Mode Logo (Optional)

Setting PHP Interpreter Path



Setting PHP Interpreter Path

जब हम PHP Scripts को Command Prompt द्वारा Run करना चाहते है , तो सबसे पहले हमें php.exe File को “path” Environment Variable में Set  करना होता है , ताकि हम हमारे Computer में कही से भी PHP Interpreter को Involve कर सकें |

चुंकि हमने WAMP Install किया है और हमारे Computer में PHP “C:\wamp64\bin\php\php5.6.40” Path पर Installed है , जहां 5.6.40PHP का Version है , जो कि बदल सकता है , इसलिए इस Path को हमें “Path” नाम के Global Variable में Set करना होगा | इसे Set करने के लिए हमें निम्न Steps Follow करने होते है |

1. Right Click on My Computer and Select “properties” Option

2. click on Advance System Settings Option . A New Dialog Box will Display .

3. Click on “Environment Variables:” Button . A New Dialog Box will Display .

4. Select “Path” from “System Variables” List and click on “Edit.. “ Button

5. New Option पर Click करें अब खली जगह पर पूरा  Path Type करें “C:\wamp64\bin\php\php5.6.40” जो निम्नानुसार चित्र में दर्शाया गया है |

6. Click “OK” , “OK” and “OK”.

उपरोक्त प्रक्रिया पूरी करने के बाद अब हम हमारे Computer में कहीं से भी Command Prompt द्वारा php.exe Interpreter को Execute कर सकते हैं | अब Start Button पर  Click करके Run Option को Select कीजिये | निम्नानुसार एक “Run” Dialog Box

यहां “cmd” Command Type करके Enter Key Press कीजिये अथवा “OK Button” पर Click कीजिये | आपके सामने निम्नानुसार Command Prompt Display हो जाएगा |

इस Command Prompt पर “php -v” Type करके Enter Key Press करने पर आपको PHP का Virsion व विभन्न प्रकार कि अन्य जानकारियां दिखाई देंगी | यदि ये जानकारियां दिखाई देती है , तो ये इस बात का Signed है कि आपके PHP Interpreter का Path पूरी तरह से Set है और आप कहीं भी PHP Interpreter को Invoke कर सकते है |

चुंकि हमारा WAMP Server ठीक से Run हो रहा है साथ ही हमने हमारे PHP Interpreter का Path भी Set कर दिया है , इसलिए अब हम Command Prompt द्वारा अपने PHP Program को Interpret कर सकते है |

हमने हमारा पहला PHP Script “C:\wamp\www\phpInHindi” नाम के Folder में Create किया था , इसलिए सबसे पहले हमें उस Folder में पहुंचना होगा | इस काम को करने के लिए हमें निम्नानुसार तीन Commands Fire करने होंगे |

सबसे पहले हमने “cd\” Command Fire किया है , जो हमें Root Directory यानी “C:” Prompt पर आ जाता है |

फिर हमने दूसरा Command “cd wamp\www\phpInHindi” Fire किया है , जो हम हमारे WAMP Server के www Folder के अंदर स्थित “phpInHindi” नाम के Folder में ले जाते है |

अंत में हमने “dir” Command किया है , जो हमें हमारे Current Folder की सभी Files Display करता है |


 

You may like these posts:

No comments:

Post a Comment