Install Nginx + PHP + MySQL tung.pdf in Ubuntu
wget http://nginx.org/download/nginx-1.1.10.tar.gzwget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gzwget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gzwget http://cdnetworks-kr-1.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gzwget http://cdnetworks-kr-1.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gzwget http://cdnetworks-kr-2.dl.sourceforge.net/project/pcre/pcre/8.20/pcre-8.20.tar.gzwget http://jp.php.net/distributions/php-5.3.8.tar.gzwget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz/from/http://ftp.jaist.ac.jp/pub/mysql/
Ubuntu 11.10 64bit is used in the operating system (the system should be pure and install some necessary tools and software)
apt-get install gcc g++ ssh automake cmake build-essential autoconf make re2c wget cron bzip2 rcconf flex vim bison m4 mawk cpp binutils libncurses5 unzip tar libncurses5 libncurses5-dev libtool libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libmcrypt-dev
Support Libraries required for compiling and installing PHP
tar zxvf libiconv-1.14.tar.gzcd libiconv-1.14/./configure --prefix=/usr/localmakemake installcd ../tar zxvf mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9./configuremakemake installcd ../tar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8/./configuremakemake install/sbin/ldconfigcd libltdl/./configure --enable-ltdl-installmakemake installcd ../../tar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8//sbin/ldconfig./configuremakemake installcd ../tar zxvf pcre-8.10.tar.gzcd pcre-8.10./configuremakemake install
Install MySQL, version 5.5.19
tar zxvf mysql-5.5.19.tar.gzcd mysql-5.5.19/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql mysqlcmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8-unicode_ci -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306makemake installcd ../mysqlcp support-files/my-small.cnf /etc/my.cnf/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/usr/local/mysql/bin/mysqld_safe --user=mysql&/usr/local/mysql/bin/mysqladmin -u root password 'XXXXXX'
After installing curl, I didn't expect the system to be pure enough to connect to curl.
apt-get install libcurl4-gnutls-dev
Install PHP and version 5.3
tar zxvf php-5.3.8.tar.gz./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap
To use LDAP and FreeType, install the following packages:
apt-get install libfreetype6-dev libjpeg8-dev libpng12-dev slapd ldap-utils db5.1-util
To use LDAP in PHP, the following two must be installed:
apt-get install libldap2-dev libsasl2-dev
The corresponding php compilation configuration is
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap
make ZEND_EXTRA_LIBS='-liconv'make testmake installcp php.ini-production /usr/local/php/etc/php.ini
Run the command to view the PHP configuration and obtain the extension-dir value of the PHP extension storage directory.
/usr/local/php/bin/php-config
Usage: /usr/local/php/bin/php-config [OPTION]Options: --prefix [/usr/local/php] --includes [-I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib] --ldflags [ -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -L/usr/local/mysql/lib] --libs [-lcrypt -lz -lresolv -lcrypt -lrt -lmysqlclient -lmcrypt -lltdl -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lcurl -lxml2 -lmysqlclient -lz -lm -lrt -ldl -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lcrypt ] --extension-dir [/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626] --include-dir [/usr/local/php/include/php] --man-dir [/usr/local/php/man] --php-binary [/usr/local/php/bin/php] --php-sapis [cli fpm] --configure-options [--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap] --version [5.3.8] --vernum [50308]