Cara setup python di apache
Hi Assalamualaikum semua. Hari ni Lee post tentang cara - cara untuk run code python di server apache.
1. Download python di https://www.python.org/downloads/
2. This PC -> Right Click ‘Properties’ -> System Properties ‘Advanced’ -> Environment Variables
3. Cari dir python, paste C:\Users\______\AppData\Local\Programs\Python\Python38-32\Scripts di PATH
4. Install pip, secara default python akan install pip untuk pengguna. Install jika pip tiada di PC anda.
5. Install env ‘py -m pip install --user virtualenv’
6. Create a virtual environment in specific project (jangan lupa untuk masukkan project file di htdocs).
7. Activate env
8. Install python library
9. Di xampp, buka httpd.conf
10. Di file httpd.conf, cari coding dan tambah config seperti di bawah (Rujukan seperti di bawah);
Sumber
https://www.python.org/downloads/
http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
Running Python scripts with Xampp
https://stackoverflow.com/a/45476400
1. Download python di https://www.python.org/downloads/
2. This PC -> Right Click ‘Properties’ -> System Properties ‘Advanced’ -> Environment Variables
3. Cari dir python, paste C:\Users\______\AppData\Local\Programs\Python\Python38-32\Scripts di PATH
4. Install pip, secara default python akan install pip untuk pengguna. Install jika pip tiada di PC anda.
5. Install env ‘py -m pip install --user virtualenv’
6. Create a virtual environment in specific project (jangan lupa untuk masukkan project file di htdocs).
7. Activate env
8. Install python library
- pymysql
- pandas
- datetime
- math
- scipy
- numpy
- relativedelta
- requests
- norm
- json
9. Di xampp, buka httpd.conf
10. Di file httpd.conf, cari coding dan tambah config seperti di bawah (Rujukan seperti di bawah);
Sumber
https://www.python.org/downloads/
http://www.aaronstannard.com/how-to-setup-a-proper-python-environment-on-windows/
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
Running Python scripts with Xampp
https://stackoverflow.com/a/45476400
Ulasan