Showing posts with label windows 7. Show all posts
Showing posts with label windows 7. Show all posts

Friday, September 1, 2017

Install mysql-python in windows



To Enable the mysql extension related python need to run the below command
pip install mysqlclient




If you are trying to use mysqlclient on WINDOWS with this failure,

   "_mysql.c(29) : fatal error C1083: Cannot open include file: 'my_config.h': N
 such file or directory"

try to install the lower version instead:

pip install mysqlclient==1.3.4

Configure Apache web server for Python on Windows

Run Python script as CGI program with Apache2.4 in Windows


1. Install Python and Apache

Python: http://python.org/download/.

Apache: http://httpd.apache.org/download.cgi


2. Configure Apache to run Python CGI

The next step is to edit ‘httpd.conf’ apache configuration file located in the apache
install directory in the conf directory.

Uncomment the below line
#LoadModule cgi_module modules/mod_cgi.so

After Uncomment
LoadModule cgi_module modules/mod_cgi.so

Search the httpd.conf file for the line

Options Indexes FollowSymLinks

Add ExecCGI to the end of the line. After adding total line looks like below

Options Indexes FollowSymLinks ExecCGI

Next, search for the following:

#AddHandler cgi-script .cgi

Uncomment this line by removing the # in front of the line,
and add a .py to the end of the line. The new line should look like this:


 AddHandler cgi-script .cgi .py



Search for the line: ScriptAlias /cgi-bin/ /whatever-path/ – when you find it,
comment out the line: that is add a # in front of the line:
(or)Other wise add the below line

ScriptAlias /cgi-bin/ "C:/Apache2.4/cgi-bin/"


3. Restart Apache


4. Run the sample python file

Here is an example assuming Python is installed in the C:\Python27 location



Save this file as test.py to your htdocs folder under your apache installation directory.
Open your web browser and type in your apache host
(and :port if the port is something other than 80) followed by test.py,
for example:   http://localhost/test.py

Monday, July 17, 2017

PHP ZMQ extension Installation in Apache 2.4 & php 5.6


PHP ZMQ extension we will look at how you can easily distribute work to background processes, provide flexible service brokering for your next service oriented architecture, and manage caches efficiently and easily with just PHP and the ZeroMQ libraries. Whether the problem is asynchronous communication, message distribution, process management or just about anything, ZeroMQ can help you build an architecture that is more resilient, more scalable and more flexible, without introducing unnecessary overhead or requiring a heavyweight queue manager node..

Installing ZMQ in Windows

Required Softwares Apache 2.4 & PHP 5.6
  1. Download the zmq php extension from following url depends up on the installed php version
    url: ZMq Download Url
  2. Extract the folder
  3. Copy the php_zmq.dll to php/ext directory
  4. Then copy the libzmq.dll to the php/ root directory
  5. Add below line in php.ini file : extension=php_zmq.dll