How to run python script in xampp on macOS
Well, I was facing Error 500 to run python file on xampp. In this blog i will show you how you can run python file on xampp server. Let’s get started.
Step: 1 Install Xampp
Step: 2 Change configuration file
Edited httpd.conf
#add .py extension
AddHandler cgi-script .cgi .pl .asp .py
Start apache web server again.
Step : 3 Create your xyz.py python file. In terminal, Go to your file path and apply below command.
chmod 755 xyz.py
Step: 4 Find python path
Go to finder, and type ctrl+shift+G.
Enter path: usr/local/bin
choose your python path: /usr/bin/python
Step: 5 Enter python path in xyz.py file
Make sure you add blank print statement before executable code. [print “”]
Step: 6 Error is solved