Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
No Result
View All Result

Install XAMPP server to run python , cgi-bin , PHP , scripts(Updated June 2017)

admin by admin
May 2, 2020
in Lập Trình PHP
23
Install XAMPP server to run python , cgi-bin , PHP , scripts(Updated June 2017)



How to set up XAMPP to run Python programs and php on your own computer. SQL works also. Only tested on windows 10.All programs can be run through localhost in browser and files stored in htdocs directory in xampp.
Xampp Version 5.6.30
Python.3.6.1

Link to Python

Link to XAMPP

Should be the same versions as mine in order to work.

Make sure to save Python as C:Python3.6 using custom installation.First line of your program must direct to where python.exe is installed.Mine is #!C:/Python3.6/python.exe .You must use parenthesis with print.

Instructions:
__________________________________________________________________
1.Install xampp and python, make sure to remember the location where everything is installed.Mine are in 1 folder.
2.When both are installed, run XAMPP.
3.add test files to htdocs mine are downloadable.
4.Open the httpd.conf file in apache by clicking config but do not start apache yet.
6. Look for AddHandler cgi-script .cgi .pl .asp and add .py to it
7.Start apache
8. open a browser, type localhost and go to it. This is your homepage.
9. To run your files type localhost/ enter in name of file. eg
localhost/hello.py
10. That’s it, it should work. Just make sure to have correct shebang on top of python files which shows the location of where python.exe is. Mine is #!C:/Python3.6/python.exe
11. You now should add passwords and run it offline if needed.
12.Python files need print(“content-type: text/htmlnn” ) below shebang in order to work.

my httpd file :

Python test program :

Php test program :

Program to run in idle to find path for shebang. Just add #! before it and double check it says python or python.exe if not just change it to the result of idle program.

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-php/

Xem thêm Bài Viết:

  • MDM là gì??? – Làm thế nào để tắt được MDM trên Macbook | Mẹo Vặt Macbook
  • Người lao động nghỉ bị trừ lương || Tư vấn luật lao động
  • Learn Emmet In 15 Minutes – Double Your HTML Coding Speed
  • Giang Hồ Thanh Toán Nhau Trên Phố – Tập 4 – Giang Hồ Bắn Giết Nhau Trên Đường | Big Bang
  • Lập trình Android A-Z – Bài 159: Fragment Create and add XML
Previous Post

The Architects - Giới thiệu khoá học lập trình From Zero to Hero

Next Post

Deer Hunter Classic Dog Hunting - Rare Series!

Next Post
Deer Hunter Classic Dog Hunting – Rare Series!

Deer Hunter Classic Dog Hunting - Rare Series!

Comments 23

  1. Suru_Kro says:
    2 years ago

    Internal server error in python?? End of script output header before .py file??
    Are you running XAMPP -server?
    Want to solve… Then go there https://youtu.be/NYevQUGexRo

    Reply
  2. Shubhamkar Joshi says:
    2 years ago

    couldn't create child process: 720005
    Im getting this error. Culd you help?

    Reply
  3. Goldensparrow Mobile says:
    2 years ago

    thnaks

    Reply
  4. Ageim says:
    2 years ago

    it just show the code
    #!c:/Python3.6/python.exe

    print("Content-type: text/html")

    print("""

    <title> a </title>

    <h1> hi</h1>

    hello

    """)

    Reply
  5. SHADOW says:
    2 years ago

    Working

    Reply
  6. Mithzy Nelson says:
    2 years ago

    You saved my butt!! Thanks!!

    Reply
  7. Shivam Singh says:
    2 years ago

    Bro It Works! Only I need to replace the path '#!C:/Python3.6/python.exe' to '#!C:UsersroxxshivamsinghAppDataLocalProgramsPythonPython37python.exe' it depends upon where your python interpreter is install check properly and copy path and paste it on the top of the page in comment using '!' symbol…

    Reply
  8. Bruno Souza says:
    2 years ago

    it doesnt working

    Reply
  9. prajwal kumar says:
    2 years ago

    but mysql module error is cmng fr me…..rest it works for me.

    Reply
  10. Steven Choo says:
    2 years ago

    if Python3.6.1 does not work, then try to download Python2.7.15 (Window users).
    I solved my problem by doing this step.

    Reply
  11. chanchal dhingra says:
    2 years ago

    not able follow after localhost

    Reply
  12. Junaid khan says:
    2 years ago

    Working Great 🙂 Even on newer version.
    Kindly I have a quaestion, How can I run that .py file from within the php file?

    Reply
  13. Peter Bennett says:
    2 years ago

    Ok guys, a couple of things you should remember…. when telling the script where your python file is located, make sure you use FORWARD slashes not back slashes, and make sure you point to the .exe not the root directory!! Worked for me, actually impressed at how simple it is!!! If this works when I deploy, I will be even happier!

    Reply
  14. TrashPanda says:
    2 years ago

    works thanks!

    Reply
  15. MImran Khan says:
    2 years ago

    Not working

    Reply
  16. Mostafa Abu Gheda says:
    2 years ago

    What is the name of this track in the video ? 😀

    Reply
  17. RoadracerSLO says:
    2 years ago

    tnx mate, just what I needed 🙂

    Reply
  18. Martin Brant says:
    2 years ago

    Hi, any chance you could give a link to your Python code? Is this Python 2 or 3? Thanks

    Reply
  19. Pandula Perera says:
    2 years ago

    Great!!!

    Reply
  20. FIRDOUS BHAT says:
    2 years ago

    how come dude ? Simply you placing python program in htdocs and it works ?

    Reply
  21. Kapil Saran says:
    2 years ago

    thxx man

    Reply
  22. radika watterson says:
    2 years ago

    hey jason , i'm from indonesia. i can't running my python on my lampp. do you have any tutorial ?

    Reply
  23. Atul Varshney says:
    2 years ago

    Hey Jason Cheung.. your video does work and it's appreciable.. but I'm stuck in running python script. Actually if i run simple python script like "Hello Python"with html tag then it does work,if i used only python script code that doesn't work , actually i want to get current URL using python script then how to do this. first of fall let me tell you. I'm getting the "Server Error!"

    So finally i just wanna say how to write any python script. because previous script has with html tag not python coding at all. So Please get me the solution. I hope you are able get me .. what i wanna ask?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

Tại sao các sàn môi giới bất động sản cần ứng dụng CRM để quản lý khách hàng

Tại sao các sàn môi giới bất động sản cần ứng dụng CRM để quản lý khách hàng

July 26, 2022
Đập hộp Z590 Vision G

Trên tay Gigabyte Z590 Vision G – Sẵn sàng cho người sáng tạo nội dung

May 15, 2021
Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

October 21, 2020
Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

September 25, 2020
Cách nhập ảnh từ iPhone sang Mac

Cách nhập ảnh từ iPhone sang Mac

September 10, 2020
Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

May 28, 2020
  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.