Skip to main content

:: build php on centos

:: what is
please take a look at this.

:: case
we can build php with support mysql, apache, gd, jpeg, png, freetype, curl, zlib, mcrypt, mbstring, ftp.

:: compile and install dependency for php support
- apache
- mysql
- gd
[ compile and installing libpng ]
[ root:~ ]# vi /etc/ld.so.conf
# add this line
/usr/local/lib
[ root:~ ]# mkdir download
[ root:~ ]# cd download/
[ root:downlad ]# wget http://sourceforge.net/projects/libpng/files/01-libpng-master/1.2.40rc01/libpng-1.2.40rc01.tar.bz2/download
[ root:downlad ]# tar -xjf libpng-1.2.40rc01.tar.bz2
[ root:downlad ]# cd libpng-1.2.39
[ root:libpng-1.2.39 ]# ./configure
[ root:libpng-1.2.39 ]# make && make install

[ compile and install libjpeg ]
[ root:downlad ]# wget http://sourceforge.net/projects/libjpeg/files/libjpeg/6b/jpegsrc.v6b.tar.gz/download
[ root:downlad ]# tar -xzf jpegsrc.v6b.tar.gz
[ root:downlad ]# cd jpeg-6b/
[ root:jpeg-6b ]# ./configure --prefix=/usr/local --enable-shared --enable-static
[ root:jpeg-6b ]# mkdir -p /usr/local/man/man1
[ root:jpeg-6b ]# make && make install
[ root:jpeg-6b ]# ldconfig

[ compile and install libfreetype ]
[ root:downlad ]# wget http://sourceforge.net/projects/freetype/files/freetype2/2.3.9/freetype-2.3.9.tar.bz2/download
[ root:downlad ]# tar -xjf freetype-2.3.9.tar.bz2
[ root:downlad ]# cd freetype-2.3.9
[ root:freetype-2.3.9 ]# ./configure
[ root:freetype-2.3.9 ]# make && make install

[ compile and install libpkg-config ]
[ root:downlad ]# wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz
[ root:downlad ]# tar -xzf pkg-config-0.22.tar.gz
[ root:downlad ]# cd pkg-config-0.22
[ root:pkg-config-0.22 ]# ./configure --prefix=/usr/local
[ root:pkg-config-0.22 ]# make && make install

[ compile and install libxml2 ]
[ root:downlad ]# wget ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
[ root:downlad ]# tar -xzf libxml2-2.7.6.tar.gz
[ root:downlad ]# cd libxml2-2.7.6
[ root:libxml2-2.7.6 ]# ./configure
[ root:libxml2-2.7.6 ]# make && make install

[ compile and install fontconfig ]
[ root:downlad ]# wget http://fontconfig.org/release/fontconfig-2.4.2.tar.gz
[ root:downlad ]# tar -xzf fontconfig-2.4.2.tar.gz
[ root:downlad ]# cd fontconfig-2.4.2
[ root:fontconfig-2.4.2 ]# ./configure
[ root:fontconfig-2.4.2 ]# make && make install

[ compile and installing gd ]
[ root:downlad ]# wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
[ root:downlad ]# tar -xzf gd-2.0.35.tar.gz
[ root:downlad ]# cd gd-2.0.35
[ root:gd-2.0.35 ]# ./configure --with-png=/usr/local/lib --with-freetype=/usr/local/lib --with-jpeg=/usr/local/lib --with-fontconfig=/usr/local/lib
[ root:gd-2.0.35 ]# ldconfig
[ root:gd-2.0.35 ]# make && make install

- zlib
[ compile and install zlib ]
[ root:downlad ]# wget http://www.zlib.net/zlib-1.2.3.tar.gz
[ root:downlad ]# tar -xzf zlib-1.2.3.tar.gz
[ root:downlad ]# cd zlib-1.2.3/
[ root:zlib-1.2.3 ]# ./configure
[ root:zlib-1.2.3 ]# make && make install

- mcrypt
[ installing libmcrypt ]
[ root:downlad ]# wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2/download
[ root:downlad ]# tar -xzf libmcrypt-2.5.8.tar.gz
[ root:downlad ]# cd libmcrypt-2.5.8
[ root:libmcrypt-2.5.8 ]# ./configure --disable-posix-threads --enable-dynamic-loading
[ root:libmcrypt-2.5.8 ]# make && make install
[ root:libmcrypt-2.5.8 ]# ldconfig
[ root:mhash-0.9.9.9 ]# cd ..

[ installing mhash ]
[ root:downlad ]# wget http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download
[ root:downlad ]# tar -xzf mhash-0.9.9.9.tar.gz
[ root:downlad ]# cd mhash-0.9.9.9
[ root:mhash-0.9.9.9 ]# ./configure
[ root:mhash-0.9.9.9 ]# make && make install
[ root:mhash-0.9.9.9 ]# ldconfig
[ root:mhash-0.9.9.9 ]# cd ..

[ installing mcrypt ]
[ root:downlad ]# wget http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download
[ root:downlad ]# tar -xzf mcrypt-2.6.8.tar.gz
[ root:downlad ]# cd mcrypt-2.6.8
[ root:mcrypt-2.6.8 ]# ./configure
[ root:mcrypt-2.6.8 ]# make && make install
[ root:mcrypt-2.6.8 ]# ldconfig
[ root:mcrypt-2.6.8 ]# cd ..

- curl
[ compile and install curl ]
[ root:downlad ]# wget http://curl.haxx.se/download/curl-7.19.6.tar.gz
[ root:downlad ]# tar -xzf curl-7.19.6.tar.gz
[ root:downlad ]# cd curl-7.19.6
[ root:curl-7.19.6 ]# ./configure
[ root:curl-7.19.6 ]# make && make install

:: compile and install php 5.3.0
[ root:downlad ]# wget http://nl2.php.net/get/php-5.3.0.tar.bz2/from/id.php.net/mirror
[ root:downlad ]# tar -xjf php-5.3.0.tar.bz2
[ root:downlad ]# cd php-5.3.0
[ root:php-5.3.0 ]# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local --with-zlib-dir=/usr/local --with-mcrypt=/usr/local/bin/mcrypt --with-curl=/usr/local --enable-mbstring --enable-ftp
[ root:php-5.3.0 ]# make && make install
[ root:php-5.3.0 ]# cp php.ini-production /usr/local/etc/php.ini
[ root:php-5.3.0 ]# vi /usr/local/etc/php.ini
; change this line
include_path = ".::/usr/local/lib/php"

:: testing
[ root:php-5.3.0 ]# php -v
PHP 5.3.0 (cli) (built: Sep 4 2009 20:20:54)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
[ root:php-5.3.0 ]# php -i | grep ^mcrypt
mcrypt
mcrypt support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
[ root:php-5.3.0 ]# php -i | grep ^gd
gd
gd.jpeg_ignore_warning => 0 => 0

:: links
+ GoogleLinux
+ BlacKonsole

Comments

Popular posts from this blog

Simple Step Installing WordPress in Ubuntu 24.04

Using ols1clk.sh Script This step will: Install OpenLiteSpeed Install PHP Secure your server Install MySQL Set up WordPress Run the script: bash <( curl -k https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh ) -w  Configuring WordPress Open your browser and navigate to your domain: http://yourdomain.com You’ll be greeted by the famous WordPress installation wizard. Follow these steps: Select your preferred language. Enter your site title, username, and password for the WordPress admin account. Click "Install WordPress." And just like that, you’ve done it!

:: Install NginX from source

:: What is NGINX nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by  Igor Sysoev . o nginx :: How to install NGINX from source on OpenSUSE + installing dependency # zypper in pcre-devel zlib-devel libopenssl-devel + create username and group # groupadd nginx # useradd -r -g nginx nginx + compile and installing nginx # wget http://nginx.org/download/nginx-1.1.8.tar.gz # tar -xzf nginx-1.1.8.tar.gz # cd nginx-1.1.8 # ./configure --user=nginx --group=nginx --with-http_ssl_module # make && make install :: Starting / restarting httpd # /usr/local/nginx/sbin/nginx # /usr/local/nginx/sbin/nginx -s reload :: Link + Google + BlacKonsole

:: How to Recompile Nginx in Ubuntu

  Recompiling Nginx on Ubuntu can be a crucial task for those who need to customize their web server to meet specific requirements. Whether you need to add new modules, optimize performance, or apply patches, recompiling Nginx allows you to tailor the server to your needs. This guide will walk you through the process step-by-step, ensuring you have a smooth and successful recompilation.   Understanding the Need for Recompilation Why Recompile Nginx? Recompiling Nginx is often necessary when you need to add or remove modules that are not included in the default package. For instance, if you need to integrate a third-party module for enhanced security or performance, recompilation is the way to go. Additionally, recompiling allows you to apply custom patches or optimizations that can significantly improve your server's efficiency. Benefits of Custom Compilation Custom compiling Nginx offers several advantages. Firstly, it provides greater control over the server's