[Linux + lighttpd + php + zeromq] environment setup

Source: Internet
Author: User
I. Introduction linuxlighttpdphpzeromq this environment is very suitable for Embedded web development. If you are working on embedded web development, this environment can provide you with a perfect solution. Function Introduction: 1. lighttpd: webserver; 2.php: Use php to implement webui and some business functions; 3. zeromq: zmq as a model

I. Introduction linux lighttpd php zeromq this environment is very suitable for Embedded web development. If you are working on embedded web development, this environment can provide you with a perfect solution. Function Introduction: 1. lighttpd: webserver; 2. php: Use php to implement webui and some business functions; 3. zeromq: zmq as a model

I. Introduction

Linux + lighttpd + php + zeromqEnvironmentIt is very suitable for Embedded web development. If you are developing embedded webEnvironmentIt provides you with the perfect solution.

Function introduction:

1. lighttpd: webserver;

2. php: Use php to implement webui and some business functions;

3. zeromq: zmq serves as an asynchronous message interaction component between modules;

The software architecture is roughly as follows:

System Module Implementation Technology Message Communication
WebUI PHP Zeromq for php
Business Module PHP + C/C ++ Zeromq for c
Underlying Module Uboot + linux + driver Zeromq for c
Hardware Embedded devices

II, EnvironmentBuild

1. Install libiconv(This is a dependent database, and it is not required if the system has one)

# Tar-zxvf libiconv-1.14.tar.gz
# Cd libiconv-1.14
#./Configure -- prefix =/usr/local/libiconv
# Make
# Make install

2. Install libzmq and libczmq Libraries

2.1. Install the tool (skip this step if your system has installed the following tool and the version is newer)
M4-latest.tar.gz
Autoconf-2.69.tar.gz
Automake-1.9.6.tar.gz
Libtool-1.5.22.tar.gz

Tool installation process:
1) copy the above tool to/usr/bin,
2) decompress (tar zxvf xxx.tar.gz)
3) sequentially go to the extracted directory and execute:
#./Configure
# Make
# Make install

2.2. Install libzmqlibrary libzmq-master.zip. Installation Process:
1) Run autogen. sh in the Code root directory.
Generate the configure file;
2) execute:
#./Configure
# Make
# Make install

2.3. Install czmq-1.4.1.tar.gz. Installation Process:
1) decompress tar zxvf czmq-1.4.1.tar.gz
2) cd czmq-1.4.1
3) execute:
#./Configure
# Make
# Make install

2.4. CZMQ installation test
# Cd./czmq-1.4.1/src
#./Czmq_selftest

3. install php and php zeromq extension methods
Copy the zmq-1.0.9 (zmq php extension package) to the ext/zmq directory of php (the directory after extraction of the php installation package as the root directory,
Then go to the root directory of the php-5.5 and execute:
#./Buildconf -- force
#. /Configure -- prefix =/usr/local/php5 -- enable-fastcgi -- enable-force-cgi-redirect -- enable-soap -- enable-sockets -- enable-sqlite-utf8 -- with-iconv =/usr /local/libiconv -- with-zmq
# Make
# Make install

4. Start the lighttpd Service (the default lighttpd has been compiled)

#./Lighttpd-D-f lighttpd. php. conf

Lighttpd. php. conf configuration file:

server.document-root = "/usr/local/boa"server.port = 2013mimetype.assign = (  ".html" => "text/html",  ".txt" => "text/plain",  ".jpg" => "image/jpeg",  ".png" => "image/png")static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )index-file.names = ( "index.html" )server.modules += ("mod_fastcgi")fastcgi.server =(  ".php" =>  ((    "socket" => "/tmp/php.socket",    "bin-path" => "/usr/local/php5/bin/php-cgi",    "bin-environment" => (        "PHP_FCGI_CHILDREN" => "16",        "PHP_FCGI_MAX_REQUESTS" => "10000"    ),    "min-procs" => 1,    "max-procs" => 1,    "idle-timeout" => 20   ))) 

Iii. Practice

: Blogs are all written with heart. I hope everyone will feel good about it and encourage them. Thank you! :

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.